~laney/ubuntu-archive-tools/update-output-helper

« back to all changes in this revision

Viewing changes to branch-livefses

  • Committer: Colin Watson
  • Date: 2015-10-22 15:52:27 UTC
  • Revision ID: cjwatson@canonical.com-20151022155227-gkix0d3qjaazx854
branch-livefses: Revert r956 and materialise the livefses collection up-front instead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
from optparse import OptionParser
23
23
 
24
 
from lazr.restfulclient.errors import BadRequest
25
24
from launchpadlib.launchpad import Launchpad
26
25
 
27
26
 
28
27
def branch_livefses(options, owner):
29
 
    for livefs in options.launchpad.livefses:
 
28
    for livefs in list(options.launchpad.livefses):
30
29
        if (livefs.owner == owner and
31
30
                livefs.distro_series == options.source_series):
32
31
            print("Branching %s for %s ..." % (
33
32
                livefs.web_link, options.dest_series.name))
34
 
            try:
35
 
                new_livefs = options.launchpad.livefses.new(
36
 
                    owner=owner, distro_series=options.dest_series,
37
 
                    name=livefs.name, metadata=livefs.metadata)
38
 
                new_livefs.require_virtualized = livefs.require_virtualized
39
 
                new_livefs.lp_save()
40
 
            except BadRequest as e:
41
 
                print("ERROR: %s" % e.content)
42
 
                continue
 
33
            new_livefs = options.launchpad.livefses.new(
 
34
                owner=owner, distro_series=options.dest_series,
 
35
                name=livefs.name, metadata=livefs.metadata)
 
36
            new_livefs.require_virtualized = livefs.require_virtualized
 
37
            new_livefs.lp_save()
43
38
            print("  %s" % new_livefs.web_link)
44
39
 
45
40