~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/model/initialisedistroseriesjob.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-06-08 19:46:35 UTC
  • mfrom: (13168.5.1 bug-793434-devel)
  • Revision ID: launchpad@pqm.canonical.com-20110608194635-qcwq6pfx5uw4dh2b
[r=allenap][bug=793434] Fix InitialiseDistroSeriesJob to accept None
        for parameters: arches, packagesets, overlays,
        overlay_pockets and overlay_components.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
    classProvides,
12
12
    implements,
13
13
    )
 
14
 
14
15
from canonical.launchpad.interfaces.lpstorm import (
15
16
    IMasterStore,
16
17
    IStore,
17
18
    )
18
 
from lp.registry.model.distroseries import DistroSeries
 
19
from lp.services.job.model.job import Job
19
20
from lp.soyuz.interfaces.distributionjob import (
20
21
    DistributionJobType,
21
22
    IInitialiseDistroSeriesJob,
26
27
    DistributionJobDerived,
27
28
    )
28
29
from lp.soyuz.scripts.initialise_distroseries import InitialiseDistroSeries
29
 
from lp.services.job.model.job import Job
30
 
from lp.services.database import bulk
31
30
 
32
31
 
33
32
class InitialiseDistroSeriesJob(DistributionJobDerived):
74
73
 
75
74
    @property
76
75
    def overlays(self):
77
 
        return tuple(self.metadata['overlays'])
 
76
        if self.metadata['overlays'] is None:
 
77
            return ()
 
78
        else:
 
79
            return tuple(self.metadata['overlays'])
78
80
 
79
81
    @property
80
82
    def overlay_pockets(self):
81
 
        return tuple(self.metadata['overlay_pockets'])
 
83
        if self.metadata['overlay_pockets'] is None:
 
84
            return ()
 
85
        else:
 
86
            return tuple(self.metadata['overlay_pockets'])
82
87
 
83
88
    @property
84
89
    def overlay_components(self):
85
 
        return tuple(self.metadata['overlay_components'])
 
90
        if self.metadata['overlay_components'] is None:
 
91
            return ()
 
92
        else:
 
93
            return tuple(self.metadata['overlay_components'])
86
94
 
87
95
    @property
88
96
    def arches(self):
89
 
        return tuple(self.metadata['arches'])
 
97
        if self.metadata['arches'] is None:
 
98
            return ()
 
99
        else:
 
100
            return tuple(self.metadata['arches'])
90
101
 
91
102
    @property
92
103
    def packagesets(self):
93
 
        return tuple(self.metadata['packagesets'])
 
104
        if self.metadata['packagesets'] is None:
 
105
            return ()
 
106
        else:
 
107
            return tuple(self.metadata['packagesets'])
94
108
 
95
109
    @property
96
110
    def rebuild(self):