diff options
author | Kei Masumoto <masumotok@nttdata.co.jp> | 2011-01-20 01:14:23 +0900 |
---|---|---|
committer | Kei Masumoto <masumotok@nttdata.co.jp> | 2011-01-20 01:14:23 +0900 |
commit | 1dc38833c75d546b1c64d2bcd1f5d9a5bab8836d (patch) | |
tree | 3180f9f99e9f64f7220d0c8d437ec6a5ada00c82 | |
parent | 6c7d7aa264c031304904ea349412e9f8da0283a8 (diff) | |
download | nova-1dc38833c75d546b1c64d2bcd1f5d9a5bab8836d.tar.gz nova-1dc38833c75d546b1c64d2bcd1f5d9a5bab8836d.tar.xz nova-1dc38833c75d546b1c64d2bcd1f5d9a5bab8836d.zip |
fixed pep8 error
-rw-r--r-- | nova/scheduler/manager.py | 7 | ||||
-rw-r--r-- | nova/service.py | 8 | ||||
-rw-r--r-- | nova/virt/fake.py | 5 |
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): |