summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nova/scheduler/manager.py7
-rw-r--r--nova/service.py8
-rw-r--r--nova/virt/fake.py5
3 files changed, 10 insertions, 10 deletions
diff --git a/nova/scheduler/manager.py b/nova/scheduler/manager.py
index f8e4e1613..1cc767a03 100644
--- a/nova/scheduler/manager.py
+++ b/nova/scheduler/manager.py
@@ -79,8 +79,8 @@ class SchedulerManager(manager.Manager):
if len(services) == 0:
return {'ret': False, 'msg': 'No such Host'}
- compute = [ s for s in services if s['topic'] == 'compute']
- if 0 == len(compute):
+ compute = [s for s in services if s['topic'] == 'compute']
+ if 0 == len(compute):
service_ref = services[0]
else:
service_ref = compute[0]
@@ -90,10 +90,9 @@ class SchedulerManager(manager.Manager):
'memory_mb': service_ref['memory_mb'],
'local_gb': service_ref['local_gb']}
-
# Getting usage resource information
u_resource = {}
- instances_ref = db.instance_get_all_by_host(context,
+ instances_ref = db.instance_get_all_by_host(context,
service_ref['host'])
if 0 == len(instances_ref):
diff --git a/nova/service.py b/nova/service.py
index 1acfe3078..a8d52e93b 100644
--- a/nova/service.py
+++ b/nova/service.py
@@ -119,11 +119,11 @@ class Service(object):
def _create_service_ref(self, context):
zone = FLAGS.node_availability_zone
service_ref = db.service_create(context,
- {'host':self.host,
- 'binary':self.binary,
- 'topic':self.topic,
+ {'host': self.host,
+ 'binary': self.binary,
+ 'topic': self.topic,
'report_count': 0,
- 'availability_zone':zone})
+ 'availability_zone': zone})
self.service_id = service_ref['id']
def __getattr__(self, key):
diff --git a/nova/virt/fake.py b/nova/virt/fake.py
index b931e3638..80ae7f34c 100644
--- a/nova/virt/fake.py
+++ b/nova/virt/fake.py
@@ -312,7 +312,7 @@ class FakeConnection(object):
def get_cpu_info(self):
"""This method is supported only libvirt. """
- return
+ return
def get_vcpu_number(self):
"""This method is supported only libvirt. """
@@ -328,7 +328,7 @@ class FakeConnection(object):
def get_hypervisor_type(self):
"""This method is supported only libvirt.."""
- return
+ return
def get_hypervisor_version(self):
"""This method is supported only libvirt.."""
@@ -342,6 +342,7 @@ class FakeConnection(object):
"""This method is supported only libvirt.."""
raise NotImplementedError('This method is supported only libvirt.')
+
class FakeInstance(object):
def __init__(self):