diff options
| author | Sandy Walsh <sandy.walsh@rackspace.com> | 2011-03-23 12:31:15 -0700 |
|---|---|---|
| committer | Sandy Walsh <sandy.walsh@rackspace.com> | 2011-03-23 12:31:15 -0700 |
| commit | 05e6f82aa971606f7d33fb1de8f2c1c170d030de (patch) | |
| tree | 7fb33849d428cd537d47c317cef87741cb8df3d7 | |
| parent | 6980263b8c31c8c8fc83e236b20950201c206e8c (diff) | |
| download | nova-05e6f82aa971606f7d33fb1de8f2c1c170d030de.tar.gz nova-05e6f82aa971606f7d33fb1de8f2c1c170d030de.tar.xz nova-05e6f82aa971606f7d33fb1de8f2c1c170d030de.zip | |
indenting cleanup
| -rw-r--r-- | nova/api/openstack/zones.py | 5 | ||||
| -rw-r--r-- | nova/compute/manager.py | 2 | ||||
| -rw-r--r-- | nova/flags.py | 2 | ||||
| -rw-r--r-- | nova/manager.py | 5 | ||||
| -rw-r--r-- | nova/rpc.py | 4 | ||||
| -rw-r--r-- | nova/scheduler/api.py | 2 | ||||
| -rw-r--r-- | nova/tests/test_zones.py | 2 |
7 files changed, 12 insertions, 10 deletions
diff --git a/nova/api/openstack/zones.py b/nova/api/openstack/zones.py index d129cf34f..d4a59993b 100644 --- a/nova/api/openstack/zones.py +++ b/nova/api/openstack/zones.py @@ -17,7 +17,6 @@ import common from nova import db from nova import flags -from nova import log as logging from nova import wsgi from nova.scheduler import api @@ -73,8 +72,8 @@ class Controller(wsgi.Controller): zone = dict(name=FLAGS.zone_name) caps = FLAGS.zone_capabilities for cap in caps: - key_values = cap.split('=') - zone[key_values[0]] = key_values[1] + key, value = cap.split('=') + zone[key] = value for item, (min_value, max_value) in items.iteritems(): zone[item] = "%s,%s" % (min_value, max_value) return dict(zone=zone) diff --git a/nova/compute/manager.py b/nova/compute/manager.py index eae1fee68..289c91d8a 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -118,7 +118,7 @@ class ComputeManager(manager.SchedulerDependentManager): self.network_manager = utils.import_object(FLAGS.network_manager) self.volume_manager = utils.import_object(FLAGS.volume_manager) super(ComputeManager, self).__init__(service_name="compute", - *args, **kwargs) + *args, **kwargs) def init_host(self): """Do any initialization that needs to be run if this is a diff --git a/nova/flags.py b/nova/flags.py index 3a8ec1a39..bf83b8e0f 100644 --- a/nova/flags.py +++ b/nova/flags.py @@ -360,4 +360,4 @@ DEFINE_string('node_availability_zone', 'nova', DEFINE_string('zone_name', 'nova', 'name of this zone') DEFINE_list('zone_capabilities', ['hypervisor=xenserver;kvm', 'os=linux;windows'], - 'Key/Multi-value list representng capabilities of this zone') + 'Key/Multi-value list representng capabilities of this zone') diff --git a/nova/manager.py b/nova/manager.py index 508f133ca..804a50479 100644 --- a/nova/manager.py +++ b/nova/manager.py @@ -59,6 +59,8 @@ from nova.scheduler import api FLAGS = flags.FLAGS +LOG = logging.getLogger('nova.manager') + class Manager(base.Base): def __init__(self, host=None, db_driver=None): @@ -83,6 +85,7 @@ class SchedulerDependentManager(Manager): should derive from this class. Otherwise they can derive from manager.Manager directly. Updates are only sent after update_service_capabilities is called with non-None values.""" + def __init__(self, host=None, db_driver=None, service_name="undefined"): self.last_capabilities = None self.service_name = service_name @@ -95,7 +98,7 @@ class SchedulerDependentManager(Manager): def periodic_tasks(self, context=None): """Pass data back to the scheduler at a periodic interval""" if self.last_capabilities: - logging.debug(_("Notifying Schedulers of capabilities ...")) + LOG.debug(_("Notifying Schedulers of capabilities ...")) api.update_service_capabilities(context, self.service_name, self.host, self.last_capabilities) diff --git a/nova/rpc.py b/nova/rpc.py index 6ddaea092..388f78d69 100644 --- a/nova/rpc.py +++ b/nova/rpc.py @@ -219,8 +219,8 @@ class FanoutAdapterConsumer(AdapterConsumer): self.queue = "%s_fanout_%s" % (topic, unique) self.durable = False LOG.info(_("Created '%(exchange)s' fanout exchange " - "with '%(key)s' routing key"), - dict(exchange=self.exchange, key=self.routing_key)) + "with '%(key)s' routing key"), + dict(exchange=self.exchange, key=self.routing_key)) super(FanoutAdapterConsumer, self).__init__(connection=connection, topic=topic, proxy=proxy) diff --git a/nova/scheduler/api.py b/nova/scheduler/api.py index e2cf3b6a3..19a05b716 100644 --- a/nova/scheduler/api.py +++ b/nova/scheduler/api.py @@ -52,7 +52,7 @@ def get_zone_capabilities(context, service=None): """Returns a dict of key, value capabilities for this zone, or for a particular class of services running in this zone.""" return _call_scheduler('get_zone_capabilities', context=context, - params=dict(service=service)) + params=dict(service=service)) def update_service_capabilities(context, service_name, host, capabilities): diff --git a/nova/tests/test_zones.py b/nova/tests/test_zones.py index 48e1442cf..688dc704d 100644 --- a/nova/tests/test_zones.py +++ b/nova/tests/test_zones.py @@ -96,7 +96,7 @@ class ZoneManagerTestCase(test.TestCase): zm.update_service_capabilities("svc10", "host1", dict(a=99, b=99)) caps = zm.get_zone_capabilities(self, None) self.assertEquals(caps, dict(svc1_a=(2, 20), svc1_b=(3, 30), - svc10_a=(99, 99), svc10_b=(99, 99))) + svc10_a=(99, 99), svc10_b=(99, 99))) zm.update_service_capabilities("svc1", "host3", dict(c=5)) caps = zm.get_zone_capabilities(self, None) |
