~therve/pyjuju/rapi-uuid

« back to all changes in this revision

Viewing changes to juju/providers/openstack/launch.py

  • Committer: Thomas Hervé
  • Date: 2013-01-17 10:37:42 UTC
  • mfrom: (556.1.52 juju)
  • Revision ID: thomas@canonical.com-20130117103742-a50xid22udignltq
Merge from trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
        # Find appropriate instance type for the given constraints. Warn
87
87
        # if deprecated is instance-type is being used.
88
88
        flavor_name = self._provider.config.get("default-instance-type")
89
 
        if flavor_name is None:
 
89
        if flavor_name is not None:
90
90
            log.warning(
91
91
                "default-instance-type is deprecated, use cli --constraints")
92
92
        flavors = yield self._provider.nova.list_flavor_details()
93
93
        flavor_id = _solve_flavor(self._constraints, flavor_name, flavors)
94
94
 
 
95
        hints = self._constraints["os-scheduler-hints"]
 
96
 
95
97
        server = yield self._provider.nova.run_server(
96
98
            name="juju %s instance %s" %
97
99
                (self._provider.environment_name, machine_id,),
98
100
            image_id=image_id,
99
101
            flavor_id=flavor_id,
100
102
            security_group_names=security_groups,
101
 
            user_data=user_data)
 
103
            user_data=user_data,
 
104
            scheduler_hints=hints,
 
105
            )
102
106
 
103
107
        if self._master:
104
108
            yield filestorage.put(id_name, StringIO(str(server['id'])))