summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandy Walsh <sandy.walsh@rackspace.com>2011-06-16 01:16:39 +0000
committerTarmac <>2011-06-16 01:16:39 +0000
commitabf96804af84327e82d47c9f7078de1c5287cddf (patch)
tree6c878b4d09f1b4ff69e4f93c9ae529b33872364b
parent57932d53e7cc5389b7d53fd8875a684f70e2eb67 (diff)
parent4b56c18bb4436c6ea76f44d2b266973f5d42817f (diff)
novaclient changed to support projectID in authentication. Caused some minor issues with distributed scheduler. This fixes them up.
-rw-r--r--nova/scheduler/api.py5
-rw-r--r--nova/scheduler/zone_aware_scheduler.py13
-rw-r--r--nova/scheduler/zone_manager.py3
-rw-r--r--tools/pip-requires2
4 files changed, 15 insertions, 8 deletions
diff --git a/nova/scheduler/api.py b/nova/scheduler/api.py
index ffe59d2c1..3b3195c2e 100644
--- a/nova/scheduler/api.py
+++ b/nova/scheduler/api.py
@@ -106,7 +106,8 @@ def _wrap_method(function, self):
def _process(func, zone):
"""Worker stub for green thread pool. Give the worker
an authenticated nova client and zone info."""
- nova = novaclient.OpenStack(zone.username, zone.password, zone.api_url)
+ nova = novaclient.OpenStack(zone.username, zone.password, None,
+ zone.api_url)
nova.authenticate()
return func(nova, zone)
@@ -122,7 +123,7 @@ def call_zone_method(context, method_name, errors_to_ignore=None,
results = []
for zone in db.zone_get_all(context):
try:
- nova = novaclient.OpenStack(zone.username, zone.password,
+ nova = novaclient.OpenStack(zone.username, zone.password, None,
zone.api_url)
nova.authenticate()
except novaclient.exceptions.BadRequest, e:
diff --git a/nova/scheduler/zone_aware_scheduler.py b/nova/scheduler/zone_aware_scheduler.py
index f04defa64..e7bff2faa 100644
--- a/nova/scheduler/zone_aware_scheduler.py
+++ b/nova/scheduler/zone_aware_scheduler.py
@@ -88,7 +88,7 @@ class ZoneAwareScheduler(driver.Scheduler):
instance_properties = request_spec['instance_properties']
name = instance_properties['display_name']
- image_id = instance_properties['image_id']
+ image_ref = instance_properties['image_ref']
meta = instance_properties['metadata']
flavor_id = instance_type['flavorid']
reservation_id = instance_properties['reservation_id']
@@ -105,13 +105,14 @@ class ZoneAwareScheduler(driver.Scheduler):
% locals())
nova = None
try:
- nova = novaclient.OpenStack(zone.username, zone.password, url)
+ nova = novaclient.OpenStack(zone.username, zone.password, None,
+ url)
nova.authenticate()
except novaclient.exceptions.BadRequest, e:
raise exception.NotAuthorized(_("Bad credentials attempting "
"to talk to zone at %(url)s.") % locals())
- nova.servers.create(name, image_id, flavor_id, ipgroup, meta, files,
+ nova.servers.create(name, image_ref, flavor_id, ipgroup, meta, files,
child_blob, reservation_id=reservation_id)
def _provision_resource_from_blob(self, context, item, instance_id,
@@ -184,7 +185,11 @@ class ZoneAwareScheduler(driver.Scheduler):
if not build_plan:
raise driver.NoValidHost(_('No hosts were available'))
- for item in build_plan:
+ for num in xrange(request_spec['num_instances']):
+ if not build_plan:
+ break
+
+ item = build_plan.pop(0)
self._provision_resource(context, item, instance_id, request_spec,
kwargs)
diff --git a/nova/scheduler/zone_manager.py b/nova/scheduler/zone_manager.py
index 3f483adff..ba7403c15 100644
--- a/nova/scheduler/zone_manager.py
+++ b/nova/scheduler/zone_manager.py
@@ -89,7 +89,8 @@ class ZoneState(object):
def _call_novaclient(zone):
"""Call novaclient. Broken out for testing purposes."""
- client = novaclient.OpenStack(zone.username, zone.password, zone.api_url)
+ client = novaclient.OpenStack(zone.username, zone.password, None,
+ zone.api_url)
return client.zones.info()._info
diff --git a/tools/pip-requires b/tools/pip-requires
index 168dacd40..7849dbea9 100644
--- a/tools/pip-requires
+++ b/tools/pip-requires
@@ -10,7 +10,7 @@ boto==1.9b
carrot==0.10.5
eventlet==0.9.12
lockfile==0.8
-python-novaclient==2.5
+python-novaclient==2.5.3
python-daemon==1.5.5
python-gflags==1.3
redis==2.0.0