~roadmr/checkbox/sortkey-fix

Viewing all changes in revision 1307.

  • Committer: Javier Collado
  • Date: 2012-03-06 16:46:06 UTC
  • Revision ID: javier.collado@canonical.com-20120306164606-wtpaukf85tp9exlg
Fixed problems in resources introduced in revision 1291.

Revision 1291 adds a new key/value pair unconditionally for each element (sortkey)
to make sure that the ordering in the job file is preserved when executing the jobs.
Unfortunatelly, it seems that resource jobs are executed more than once
(at least package one) and an exception was raised when processing the template again:
Exception: Template <stream> has a duplicate field 'sortkey' with a new value '0'.

To fix that situation, this change just makes sure that `sortkey` is added to the element
after it has been processed only if the key doesn't exist. This way, there won't be
any duplicated key problem regardless of how many times the element is processed.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: