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

« back to all changes in this revision

Viewing changes to deployer/action/importer.py

  • Committer: Madison Scott-Clary
  • Date: 2015-03-24 17:38:56 UTC
  • Revision ID: matthew.scott@canonical.com-20150324173856-gy0d5ix8gtm6e792
Add series to machine spec.

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
        """Create machines as specified in the machine spec in the bundle.
61
61
 
62
62
        A machine spec consists of a named machine (the name is, by convention,
63
 
        an integer) with optional constraints and optional annotations:
 
63
        an integer) with an optional series, optional constraints and optional
 
64
        annotations:
64
65
 
65
66
        0:
66
 
          constraints: 'mem=4G arch=i386'
 
67
          series: "precise"
 
68
          constraints: "mem=4G arch=i386"
67
69
          annotations:
68
70
            foo: bar
69
71
        1:
70
 
          constraints: 'mem=4G'
 
72
          constraints: "mem=4G"
71
73
        
72
74
        This method first attempts to create any machines in the 'machines'
73
75
        section of the bundle specification with the given constraints and
79
81
            self.log.info("Creating machines...")
80
82
            for machine_name, spec in machines.items():
81
83
                self.machines[machine_name] = self.env.add_machine(
82
 
                        series=self.deployment.data.series,
 
84
                        series=spec.get('series', 
 
85
                                        self.deployment.data['series']),
83
86
                        constraints=spec.get('constraints'))
84
87
                annotations = spec.get('annotations')
85
88
                if annotations: