~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

Change all uses of 'initialise' to 'initialize'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
__metaclass__ = type
5
5
 
6
6
__all__ = [
7
 
    "InitialiseDistroSeriesJob",
 
7
    "InitializeDistroSeriesJob",
8
8
]
9
9
 
10
10
from zope.interface import (
19
19
from lp.services.job.model.job import Job
20
20
from lp.soyuz.interfaces.distributionjob import (
21
21
    DistributionJobType,
22
 
    IInitialiseDistroSeriesJob,
23
 
    IInitialiseDistroSeriesJobSource,
 
22
    IInitializeDistroSeriesJob,
 
23
    IInitializeDistroSeriesJobSource,
24
24
    )
25
25
from lp.soyuz.model.distributionjob import (
26
26
    DistributionJob,
27
27
    DistributionJobDerived,
28
28
    )
29
 
from lp.soyuz.scripts.initialise_distroseries import InitialiseDistroSeries
30
 
 
31
 
 
32
 
class InitialiseDistroSeriesJob(DistributionJobDerived):
33
 
 
34
 
    implements(IInitialiseDistroSeriesJob)
35
 
 
36
 
    class_job_type = DistributionJobType.INITIALISE_SERIES
37
 
    classProvides(IInitialiseDistroSeriesJobSource)
 
29
from lp.soyuz.scripts.initialize_distroseries import InitializeDistroSeries
 
30
 
 
31
 
 
32
class InitializeDistroSeriesJob(DistributionJobDerived):
 
33
 
 
34
    implements(IInitializeDistroSeriesJob)
 
35
 
 
36
    class_job_type = DistributionJobType.INITIALIZE_SERIES
 
37
    classProvides(IInitializeDistroSeriesJobSource)
38
38
 
39
39
    @classmethod
40
40
    def create(cls, child, parents, arches=(), packagesets=(),
41
41
               rebuild=False, overlays=(), overlay_pockets=(),
42
42
               overlay_components=()):
43
 
        """See `IInitialiseDistroSeriesJob`."""
 
43
        """See `IInitializeDistroSeriesJob`."""
44
44
        metadata = {
45
45
            'parents': parents,
46
46
            'arches': arches,
58
58
 
59
59
    @classmethod
60
60
    def getPendingJobsForDistroseries(cls, distroseries):
61
 
        """See `IInitialiseDistroSeriesJob`."""
 
61
        """See `IInitializeDistroSeriesJob`."""
62
62
        return IStore(DistributionJob).find(
63
63
            DistributionJob,
64
64
            DistributionJob.job_id == Job.id,
65
65
            DistributionJob.job_type ==
66
 
                DistributionJobType.INITIALISE_SERIES,
 
66
                DistributionJobType.INITIALIZE_SERIES,
67
67
            DistributionJob.distroseries_id == distroseries.id,
68
68
            Job._status.is_in(Job.PENDING_STATUSES))
69
69
 
112
112
 
113
113
    def run(self):
114
114
        """See `IRunnableJob`."""
115
 
        ids = InitialiseDistroSeries(
 
115
        ids = InitializeDistroSeries(
116
116
            self.distroseries, self.parents, self.arches,
117
117
            self.packagesets, self.rebuild, self.overlays,
118
118
            self.overlay_pockets, self.overlay_components)
119
119
        ids.check()
120
 
        ids.initialise()
 
120
        ids.initialize()
121
121
 
122
122
    def getOopsVars(self):
123
123
        """See `IRunnableJob`."""
124
 
        vars = super(InitialiseDistroSeriesJob, self).getOopsVars()
 
124
        vars = super(InitializeDistroSeriesJob, self).getOopsVars()
125
125
        vars.append(('parent_distroseries_ids', self.metadata.get("parents")))
126
126
        return vars