summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin L. Mitchell <kevin.mitchell@rackspace.com>2011-09-08 20:27:33 +0000
committerTarmac <>2011-09-08 20:27:33 +0000
commitb48ccfdfbc42f399aaeb29e5305c3855a719b02d (patch)
treeb3202d27cf15e155f89c35eb5c3bb707dd50a7f0
parent22690ddbe73cdd0087d0b5c6d82be7ecdf048932 (diff)
parentc8a48eec1fb9f205af5cef2b882fc171bcca4d57 (diff)
downloadnova-b48ccfdfbc42f399aaeb29e5305c3855a719b02d.tar.gz
nova-b48ccfdfbc42f399aaeb29e5305c3855a719b02d.tar.xz
nova-b48ccfdfbc42f399aaeb29e5305c3855a719b02d.zip
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.
-rw-r--r--nova/scheduler/abstract_scheduler.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/nova/scheduler/abstract_scheduler.py b/nova/scheduler/abstract_scheduler.py
index cb8db599f..e5ea0f4e4 100644
--- a/nova/scheduler/abstract_scheduler.py
+++ b/nova/scheduler/abstract_scheduler.py
@@ -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):