~makyo/juju-deployer/machines-and-placement

« back to all changes in this revision

Viewing changes to deployer/deployment.py

  • Committer: Madison Scott-Clary
  • Date: 2015-03-16 23:43:50 UTC
  • Revision ID: matthew.scott@canonical.com-20150316234350-yrg1xxw347ij4nx0
Move machines_map to constructor.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
        self.include_dirs = include_dirs
23
23
        self.repo_path = repo_path
24
24
        self.version = version
 
25
        self.machines = {}
25
26
 
26
27
    @property
27
28
    def series(self):
52
53
            services.sort(self._machines_placement_sort)
53
54
        return services
54
55
 
 
56
    def set_machines(self, machines):
 
57
        """Set a dict of machines, mapping from the names in the machine spec
 
58
        to the machine names in the environment status.
 
59
        """
 
60
        self.machines = machines
 
61
 
55
62
    def get_machines(self):
56
63
        """Return a dict mapping machine names to machine options.
57
64
 
98
105
        if self.version == 3:
99
106
            return ServiceUnitPlacementV3(svc, self, status)
100
107
        else:
101
 
            return ServiceUnitPlacementV4(svc, self, status)
 
108
            return ServiceUnitPlacementV4(svc, self, status,
 
109
                                          machines_map=self.machines)
102
110
 
103
111
    def get_relations(self):
104
112
        if 'relations' not in self.data: