From 186c49409c841bd2bba50ea8629ec214a7fb9627 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Fri, 17 May 2013 12:53:32 -0700 Subject: [PATCH] Fix flake8 errors in anticipation of flake8. Change-Id: I7c713f95eb974d5998d2be50722df7d6f64a234e --- nova/api/openstack/compute/contrib/floating_ips.py | 2 +- nova/cmd/spicehtml5proxy.py | 8 ++++---- nova/tests/compute/test_compute.py | 6 +++--- nova/tests/compute/test_multiple_nodes.py | 2 +- nova/tests/integrated/test_api_samples.py | 4 ++-- nova/tests/test_db_api.py | 4 ++-- nova/tests/test_libvirt.py | 8 ++++---- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/nova/api/openstack/compute/contrib/floating_ips.py b/nova/api/openstack/compute/contrib/floating_ips.py index d2cf99431d60..a698e049c59d 100644 --- a/nova/api/openstack/compute/contrib/floating_ips.py +++ b/nova/api/openstack/compute/contrib/floating_ips.py @@ -244,7 +244,7 @@ class FloatingIPActionController(wsgi.Controller): if not fixed_address: fixed_address = fixed_ips[0]['address'] - if len(fixed_ips) > 1: + if len(fixed_ips) > 1: msg = _('multiple fixed_ips exist, using the first: %s') LOG.warning(msg, fixed_address) diff --git a/nova/cmd/spicehtml5proxy.py b/nova/cmd/spicehtml5proxy.py index 8e005bcadef1..c6f2be53db70 100644 --- a/nova/cmd/spicehtml5proxy.py +++ b/nova/cmd/spicehtml5proxy.py @@ -59,13 +59,13 @@ opts = [ help='Port on which to listen for incoming requests'), ] -CONF = cfg.CONF -CONF.register_cli_opts(opts) -CONF.import_opt('debug', 'nova.openstack.common.log') - def main(): # Setup flags + + CONF = cfg.CONF + CONF.register_cli_opts(opts) + CONF.import_opt('debug', 'nova.openstack.common.log') config.parse_args(sys.argv) if CONF.ssl_only and not os.path.exists(CONF.cert): diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py index cef9d2cb32f8..a52cb9be0f30 100644 --- a/nova/tests/compute/test_compute.py +++ b/nova/tests/compute/test_compute.py @@ -135,7 +135,7 @@ class BaseTestCase(test.TestCase): 'memory_mb': 131072, 'current_workload': 0, 'vcpus': 16, - 'cpu_info':'ppc64,powervm,3940', + 'cpu_info': 'ppc64,powervm,3940', 'running_vms': 0, 'free_disk_gb': 259, 'service_id': 7, @@ -5706,7 +5706,7 @@ class ComputeAPITestCase(BaseTestCase): def fake_get_instance_bdms(*args, **kwargs): return [{'device_name': '/dev/vda', - 'volume_id':'bf0b6b00-a20c-11e2-9e96-0800200c9a66'}] + 'volume_id': 'bf0b6b00-a20c-11e2-9e96-0800200c9a66'}] self.stubs.Set(self.compute_api, 'get_instance_bdms', fake_get_instance_bdms) @@ -6964,7 +6964,7 @@ class ComputeAPITestCase(BaseTestCase): def fake_get_instance_bdms(*args, **kwargs): return [{'device_name': '/dev/vda', - 'volume_id':'bf0b6b00-a20c-11e2-9e96-0800200c9a66'}] + 'volume_id': 'bf0b6b00-a20c-11e2-9e96-0800200c9a66'}] self.stubs.Set(self.compute_api, 'get_instance_bdms', fake_get_instance_bdms) diff --git a/nova/tests/compute/test_multiple_nodes.py b/nova/tests/compute/test_multiple_nodes.py index c44d9974e4db..b9a17cefea91 100644 --- a/nova/tests/compute/test_multiple_nodes.py +++ b/nova/tests/compute/test_multiple_nodes.py @@ -97,7 +97,7 @@ class MultiNodeComputeTestCase(BaseTestCase): 'memory_mb': 131072, 'current_workload': 0, 'vcpus': 16, - 'cpu_info':'ppc64,powervm,3940', + 'cpu_info': 'ppc64,powervm,3940', 'running_vms': 0, 'free_disk_gb': 259, 'service_id': 7, diff --git a/nova/tests/integrated/test_api_samples.py b/nova/tests/integrated/test_api_samples.py index e24f241898f1..6979a7510866 100644 --- a/nova/tests/integrated/test_api_samples.py +++ b/nova/tests/integrated/test_api_samples.py @@ -1110,8 +1110,8 @@ class SecurityGroupsSampleJsonTest(ServersSampleBase): subs = { 'group_name': 'test' } - return self._do_post('servers/%s/action' % uuid, - 'security-group-add-post-req', subs) + return self._do_post('servers/%s/action' % uuid, + 'security-group-add-post-req', subs) def test_security_group_create(self): response = self._create_security_group() diff --git a/nova/tests/test_db_api.py b/nova/tests/test_db_api.py index 1239c46275a1..4afefdfc8d4c 100644 --- a/nova/tests/test_db_api.py +++ b/nova/tests/test_db_api.py @@ -3744,8 +3744,8 @@ class VirtualInterfaceTestCase(test.TestCase, ModelsObjectComparatorMixin): self._create_virt_interface, {"uuid": vif['uuid']}) def test_virtual_interface_get(self): - vifs = [self._create_virt_interface({'address':'a'}), - self._create_virt_interface({'address':'b'})] + vifs = [self._create_virt_interface({'address': 'a'}), + self._create_virt_interface({'address': 'b'})] for vif in vifs: real_vif = db.virtual_interface_get(self.ctxt, vif['id']) diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py index 6d83327693dd..338a1559f62b 100644 --- a/nova/tests/test_libvirt.py +++ b/nova/tests/test_libvirt.py @@ -3175,13 +3175,13 @@ class LibvirtConnTestCase(test.TestCase): fake_disks = {'fake1': [{'type': 'qcow2', 'path': '/somepath/disk1', 'virt_disk_size': '10737418240', 'backing_file': '/somepath/disk1', - 'disk_size':'83886080', - 'over_committed_disk_size':'10653532160'}], + 'disk_size': '83886080', + 'over_committed_disk_size': '10653532160'}], 'fake2': [{'type': 'raw', 'path': '/somepath/disk2', 'virt_disk_size': '0', 'backing_file': '/somepath/disk2', - 'disk_size':'10737418240', - 'over_committed_disk_size':'0'}]} + 'disk_size': '10737418240', + 'over_committed_disk_size': '0'}]} def get_info(instance_name): return jsonutils.dumps(fake_disks.get(instance_name))