One more bug fix to make zones work in trunk. Basic problem is that in novaclient using the 1.0 OSAPI, servers.create() takes an ipgroups argument, but when using the 1.1 OSAPI, it doesn't, which means booting instances in child zones won't work with OSAPI v1.0. This fix works around that by using keyword arguments for all the arguments after the flavor, and dropping the unused ipgroups argument.
This commit is contained in:
@@ -110,7 +110,6 @@ class AbstractScheduler(driver.Scheduler):
|
||||
flavor_id = instance_type['flavorid']
|
||||
reservation_id = instance_properties['reservation_id']
|
||||
files = kwargs['injected_files']
|
||||
ipgroup = None # Not supported in OS API ... yet
|
||||
child_zone = zone_info['child_zone']
|
||||
child_blob = zone_info['child_blob']
|
||||
zone = db.zone_get(context, child_zone)
|
||||
@@ -124,8 +123,17 @@ class AbstractScheduler(driver.Scheduler):
|
||||
except novaclient_exceptions.BadRequest, e:
|
||||
raise exception.NotAuthorized(_("Bad credentials attempting "
|
||||
"to talk to zone at %(url)s.") % locals())
|
||||
nova.servers.create(name, image_ref, flavor_id, ipgroup, meta, files,
|
||||
child_blob, reservation_id=reservation_id)
|
||||
# NOTE(Vek): Novaclient has two different calling conventions
|
||||
# for this call, depending on whether you're using
|
||||
# 1.0 or 1.1 API: in 1.0, there's an ipgroups
|
||||
# argument after flavor_id which isn't present in
|
||||
# 1.1. To work around this, all the extra
|
||||
# arguments are passed as keyword arguments
|
||||
# (there's a reasonable default for ipgroups in the
|
||||
# novaclient call).
|
||||
nova.servers.create(name, image_ref, flavor_id,
|
||||
meta=meta, files=files, zone_blob=child_blob,
|
||||
reservation_id=reservation_id)
|
||||
|
||||
def _provision_resource_from_blob(self, context, build_plan_item,
|
||||
instance_id, request_spec, kwargs):
|
||||
|
||||
Reference in New Issue
Block a user