summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Waldon <bcwaldon@gmail.com>2012-05-24 06:56:15 -0700
committerBrian Waldon <bcwaldon@gmail.com>2012-05-24 06:59:05 -0700
commit317378f742aafd59d0aaa6c5698bbda57cbfa15a (patch)
tree6903bc2a95296a592a90372d6b0e6122ad5940e4
parente3d7d3a805355340f27b9626f83eda329f358fda (diff)
downloadnova-317378f742aafd59d0aaa6c5698bbda57cbfa15a.tar.gz
nova-317378f742aafd59d0aaa6c5698bbda57cbfa15a.tar.xz
nova-317378f742aafd59d0aaa6c5698bbda57cbfa15a.zip
Update pep8 dependency to v1.1
The latest release of pep8 adds stricter rules for extraneous whitespace within lines. This patch also addresses these new violations acoss the codebase. Change-Id: Ib7e50281870473df1704ed50868c5c2e26bdb02e
-rw-r--r--nova/api/openstack/compute/contrib/hosts.py2
-rw-r--r--nova/api/openstack/compute/contrib/networks.py2
-rw-r--r--nova/tests/api/openstack/compute/contrib/test_admin_actions.py2
-rw-r--r--nova/tests/api/openstack/compute/contrib/test_disk_config.py2
-rw-r--r--nova/tests/api/openstack/compute/contrib/test_scheduler_hints.py2
-rw-r--r--nova/tests/api/openstack/compute/contrib/test_security_groups.py4
-rw-r--r--nova/tests/api/openstack/compute/contrib/test_simple_tenant_usage.py18
-rw-r--r--nova/virt/baremetal/nodes.py2
-rw-r--r--nova/virt/baremetal/proxy.py6
-rw-r--r--nova/virt/fake.py6
-rw-r--r--nova/virt/libvirt/connection.py8
-rw-r--r--nova/virt/vmwareapi/vmops.py2
-rw-r--r--nova/virt/xenapi/connection.py6
-rw-r--r--nova/virt/xenapi/volume_utils.py2
-rw-r--r--nova/vnc/xvp_proxy.py10
-rwxr-xr-xtools/hacking.py8
-rw-r--r--tools/test-requires2
-rw-r--r--tools/xenserver/vdi_chain_cleanup.py2
-rw-r--r--tox.ini2
19 files changed, 44 insertions, 44 deletions
diff --git a/nova/api/openstack/compute/contrib/hosts.py b/nova/api/openstack/compute/contrib/hosts.py
index d75aca718..e9d342c53 100644
--- a/nova/api/openstack/compute/contrib/hosts.py
+++ b/nova/api/openstack/compute/contrib/hosts.py
@@ -270,7 +270,7 @@ class HostController(object):
vcpus = [i['vcpus'] for i in instance_refs
if i['project_id'] == project_id]
- mem = [i['memory_mb'] for i in instance_refs
+ mem = [i['memory_mb'] for i in instance_refs
if i['project_id'] == project_id]
disk = [i['root_gb'] + i['ephemeral_gb'] for i in instance_refs
diff --git a/nova/api/openstack/compute/contrib/networks.py b/nova/api/openstack/compute/contrib/networks.py
index 8b7a646a2..59bed97c2 100644
--- a/nova/api/openstack/compute/contrib/networks.py
+++ b/nova/api/openstack/compute/contrib/networks.py
@@ -82,7 +82,7 @@ class NetworkController(object):
authorize(context)
networks = self.network_api.get_all(context)
result = [network_dict(net_ref) for net_ref in networks]
- return {'networks': result}
+ return {'networks': result}
def show(self, req, id):
context = req.environ['nova.context']
diff --git a/nova/tests/api/openstack/compute/contrib/test_admin_actions.py b/nova/tests/api/openstack/compute/contrib/test_admin_actions.py
index df2a26f86..cc48b7c66 100644
--- a/nova/tests/api/openstack/compute/contrib/test_admin_actions.py
+++ b/nova/tests/api/openstack/compute/contrib/test_admin_actions.py
@@ -17,7 +17,7 @@ import json
import webob
-from nova.api.openstack import compute as compute_api
+from nova.api.openstack import compute as compute_api
from nova import compute
from nova import context
from nova import exception
diff --git a/nova/tests/api/openstack/compute/contrib/test_disk_config.py b/nova/tests/api/openstack/compute/contrib/test_disk_config.py
index c9e4145e4..59ae14ac8 100644
--- a/nova/tests/api/openstack/compute/contrib/test_disk_config.py
+++ b/nova/tests/api/openstack/compute/contrib/test_disk_config.py
@@ -17,7 +17,7 @@
import datetime
-from nova.api.openstack import compute
+from nova.api.openstack import compute
from nova.api.openstack.compute import extensions
from nova.api.openstack import wsgi
import nova.db.api
diff --git a/nova/tests/api/openstack/compute/contrib/test_scheduler_hints.py b/nova/tests/api/openstack/compute/contrib/test_scheduler_hints.py
index 59ad8abbc..b5a3f765a 100644
--- a/nova/tests/api/openstack/compute/contrib/test_scheduler_hints.py
+++ b/nova/tests/api/openstack/compute/contrib/test_scheduler_hints.py
@@ -15,7 +15,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-from nova.api.openstack import compute
+from nova.api.openstack import compute
from nova.api.openstack.compute import extensions
from nova.api.openstack import wsgi
import nova.db.api
diff --git a/nova/tests/api/openstack/compute/contrib/test_security_groups.py b/nova/tests/api/openstack/compute/contrib/test_security_groups.py
index f864ab648..1778068bb 100644
--- a/nova/tests/api/openstack/compute/contrib/test_security_groups.py
+++ b/nova/tests/api/openstack/compute/contrib/test_security_groups.py
@@ -815,7 +815,7 @@ class TestSecurityGroupRules(test.TestCase):
self.assertRaises(webob.exc.HTTPBadRequest, self.controller.create,
req, {'security_group_rule': rule})
- def _test_create_with_no_ports(self, proto):
+ def _test_create_with_no_ports(self, proto):
rule = {'ip_protocol': proto, 'parent_group_id': '2', 'group_id': '1'}
req = fakes.HTTPRequest.blank('/v2/fake/os-security-group-rules')
@@ -844,7 +844,7 @@ class TestSecurityGroupRules(test.TestCase):
self._test_create_with_no_ports_and_no_group('udp')
self._test_create_with_no_ports('udp')
- def _test_create_with_ports(self, id_val, proto, from_port, to_port):
+ def _test_create_with_ports(self, id_val, proto, from_port, to_port):
rule = {
'ip_protocol': proto, 'from_port': from_port, 'to_port': to_port,
'parent_group_id': '2', 'group_id': '1'
diff --git a/nova/tests/api/openstack/compute/contrib/test_simple_tenant_usage.py b/nova/tests/api/openstack/compute/contrib/test_simple_tenant_usage.py
index 86c8b5f00..09b59a137 100644
--- a/nova/tests/api/openstack/compute/contrib/test_simple_tenant_usage.py
+++ b/nova/tests/api/openstack/compute/contrib/test_simple_tenant_usage.py
@@ -55,15 +55,15 @@ def fake_instance_type_get(self, context, instance_type_id):
def get_fake_db_instance(start, end, instance_id, tenant_id):
- return {'id': instance_id,
- 'image_ref': '1',
- 'project_id': tenant_id,
- 'user_id': 'fakeuser',
- 'display_name': 'name',
- 'state_description': 'state',
- 'instance_type_id': 1,
- 'launched_at': start,
- 'terminated_at': end}
+ return {'id': instance_id,
+ 'image_ref': '1',
+ 'project_id': tenant_id,
+ 'user_id': 'fakeuser',
+ 'display_name': 'name',
+ 'state_description': 'state',
+ 'instance_type_id': 1,
+ 'launched_at': start,
+ 'terminated_at': end}
def fake_instance_get_active_by_window(self, context, begin, end, project_id):
diff --git a/nova/virt/baremetal/nodes.py b/nova/virt/baremetal/nodes.py
index a01bba428..b4f2a50e2 100644
--- a/nova/virt/baremetal/nodes.py
+++ b/nova/virt/baremetal/nodes.py
@@ -34,7 +34,7 @@ FLAGS.register_opts(baremetal_opts)
def get_baremetal_nodes():
d = FLAGS.baremetal_driver
- if d == 'tilera':
+ if d == 'tilera':
return tilera.get_baremetal_nodes()
elif d == 'fake':
return fake.get_baremetal_nodes()
diff --git a/nova/virt/baremetal/proxy.py b/nova/virt/baremetal/proxy.py
index 274c0ba03..90011f28b 100644
--- a/nova/virt/baremetal/proxy.py
+++ b/nova/virt/baremetal/proxy.py
@@ -666,9 +666,9 @@ class ProxyConnection(driver.ComputeDriver):
#TODO(mdragon): console proxy should be implemented for baremetal,
# in case someone wants to use it.
# For now return fake data.
- return {'address': '127.0.0.1',
- 'username': 'fakeuser',
- 'password': 'fakepassword'}
+ return {'address': '127.0.0.1',
+ 'username': 'fakeuser',
+ 'password': 'fakepassword'}
def refresh_security_group_rules(self, security_group_id):
# Bare metal doesn't currently support security groups
diff --git a/nova/virt/fake.py b/nova/virt/fake.py
index 51ea50879..36cfa54d2 100644
--- a/nova/virt/fake.py
+++ b/nova/virt/fake.py
@@ -225,9 +225,9 @@ class FakeConnection(driver.ComputeDriver):
'port': 6969}
def get_console_pool_info(self, console_type):
- return {'address': '127.0.0.1',
- 'username': 'fakeuser',
- 'password': 'fakepassword'}
+ return {'address': '127.0.0.1',
+ 'username': 'fakeuser',
+ 'password': 'fakepassword'}
def refresh_security_group_rules(self, security_group_id):
return True
diff --git a/nova/virt/libvirt/connection.py b/nova/virt/libvirt/connection.py
index 23429e84d..7e012a87c 100644
--- a/nova/virt/libvirt/connection.py
+++ b/nova/virt/libvirt/connection.py
@@ -1900,7 +1900,7 @@ class LibvirtConnection(driver.ComputeDriver):
else:
avail = (int(m[idx1 + 1]) + int(m[idx2 + 1]) + int(m[idx3 + 1]))
# Convert it to MB
- return self.get_memory_mb_total() - avail / 1024
+ return self.get_memory_mb_total() - avail / 1024
def get_local_gb_used(self):
"""Get the free hdd size(GB) of physical computer.
@@ -2021,9 +2021,9 @@ class LibvirtConnection(driver.ComputeDriver):
#TODO(mdragon): console proxy should be implemented for libvirt,
# in case someone wants to use it with kvm or
# such. For now return fake data.
- return {'address': '127.0.0.1',
- 'username': 'fakeuser',
- 'password': 'fakepassword'}
+ return {'address': '127.0.0.1',
+ 'username': 'fakeuser',
+ 'password': 'fakepassword'}
def refresh_security_group_rules(self, security_group_id):
self.firewall_driver.refresh_security_group_rules(security_group_id)
diff --git a/nova/virt/vmwareapi/vmops.py b/nova/virt/vmwareapi/vmops.py
index f236b6ac9..1e35776fa 100644
--- a/nova/virt/vmwareapi/vmops.py
+++ b/nova/virt/vmwareapi/vmops.py
@@ -793,7 +793,7 @@ class VMWareVMOps(object):
task_info = self._session._call_method(vim_util,
"get_dynamic_property",
search_task, "Task", "info")
- if task_info.state in ['queued', 'running']:
+ if task_info.state in ['queued', 'running']:
time.sleep(2)
continue
break
diff --git a/nova/virt/xenapi/connection.py b/nova/virt/xenapi/connection.py
index 35634ac11..184e34aa4 100644
--- a/nova/virt/xenapi/connection.py
+++ b/nova/virt/xenapi/connection.py
@@ -366,9 +366,9 @@ class XenAPIConnection(driver.ComputeDriver):
def get_console_pool_info(self, console_type):
xs_url = urlparse.urlparse(FLAGS.xenapi_connection_url)
- return {'address': xs_url.netloc,
- 'username': FLAGS.xenapi_connection_username,
- 'password': FLAGS.xenapi_connection_password}
+ return {'address': xs_url.netloc,
+ 'username': FLAGS.xenapi_connection_username,
+ 'password': FLAGS.xenapi_connection_password}
def update_available_resource(self, ctxt, host):
"""Updates compute manager resource info on ComputeNode table.
diff --git a/nova/virt/xenapi/volume_utils.py b/nova/virt/xenapi/volume_utils.py
index 9c207a4cd..e93e1b81e 100644
--- a/nova/virt/xenapi/volume_utils.py
+++ b/nova/virt/xenapi/volume_utils.py
@@ -373,7 +373,7 @@ def _get_target_port(iscsi_string):
"""Retrieve target port"""
if iscsi_string:
return iscsi_string[iscsi_string.find(':') + 1:]
- elif iscsi_string is None or FLAGS.target_port:
+ elif iscsi_string is None or FLAGS.target_port:
return FLAGS.target_port
diff --git a/nova/vnc/xvp_proxy.py b/nova/vnc/xvp_proxy.py
index 1eca54530..593b4aa9f 100644
--- a/nova/vnc/xvp_proxy.py
+++ b/nova/vnc/xvp_proxy.py
@@ -178,8 +178,8 @@ def get_wsgi_server():
LOG.audit(_("Starting nova-xvpvncproxy node (version %s)"),
version.version_string_with_vcs())
- return wsgi.Server("XCP VNC Proxy",
- XCPVNCProxy(),
- protocol=SafeHttpProtocol,
- host=FLAGS.xvpvncproxy_host,
- port=FLAGS.xvpvncproxy_port)
+ return wsgi.Server("XCP VNC Proxy",
+ XCPVNCProxy(),
+ protocol=SafeHttpProtocol,
+ host=FLAGS.xvpvncproxy_host,
+ port=FLAGS.xvpvncproxy_port)
diff --git a/tools/hacking.py b/tools/hacking.py
index 6a9b1bdc8..485030f99 100755
--- a/tools/hacking.py
+++ b/tools/hacking.py
@@ -61,7 +61,7 @@ def import_normalize(line):
split_line[2] == "import" and split_line[3] != "*" and
split_line[1] != "__future__" and
(len(split_line) == 4 or
- (len(split_line) == 6 and split_line[4] == "as"))):
+ (len(split_line) == 6 and split_line[4] == "as"))):
mod = split_line[3]
return "import %s.%s" % (split_line[1], split_line[3])
else:
@@ -214,8 +214,8 @@ def nova_import_alphabetical(physical_line, line_number, lines):
).strip().lower().split()
# with or without "as y"
length = [2, 4]
- if (len(split_line) in length and len(split_previous) in length and
- split_line[0] == "import" and split_previous[0] == "import"):
+ if (len(split_line) in length and len(split_previous) in length and
+ split_line[0] == "import" and split_previous[0] == "import"):
if split_line[1] < split_previous[1]:
return (0, "NOVA N306: imports not in alphabetical order (%s, %s)"
% (split_previous[1], split_line[1]))
@@ -244,7 +244,7 @@ def nova_docstring_one_line(physical_line):
"""
pos = max([physical_line.find(i) for i in DOCSTRING_TRIPLE]) # start
end = max([physical_line[-4:-1] == i for i in DOCSTRING_TRIPLE]) # end
- if (pos != -1 and end and len(physical_line) > pos + 4):
+ if (pos != -1 and end and len(physical_line) > pos + 4):
if (physical_line[-5] != '.'):
return pos, "NOVA N402: one line docstring needs a period"
diff --git a/tools/test-requires b/tools/test-requires
index 337e6e388..51ef2ff63 100644
--- a/tools/test-requires
+++ b/tools/test-requires
@@ -6,6 +6,6 @@ mox==0.5.3
nose
nosexcover
openstack.nose_plugin
-pep8==1.0.1
+pep8==1.1
sphinx>=1.1.2
MySQL-python
diff --git a/tools/xenserver/vdi_chain_cleanup.py b/tools/xenserver/vdi_chain_cleanup.py
index 4d4892d8b..de1744c5b 100644
--- a/tools/xenserver/vdi_chain_cleanup.py
+++ b/tools/xenserver/vdi_chain_cleanup.py
@@ -94,7 +94,7 @@ def main():
stdout = stdout.strip()
- if stdout.endswith('.vhd'):
+ if stdout.endswith('.vhd'):
try:
descendents[stdout].append(fname)
except KeyError:
diff --git a/tox.ini b/tox.ini
index 7108fb529..a3820cad1 100644
--- a/tox.ini
+++ b/tox.ini
@@ -12,7 +12,7 @@ sitepackages = True
downloadcache = ~/cache/pip
[testenv:pep8]
-deps = pep8==1.0.1
+deps = pep8==1.1
commands = /bin/bash run_tests.sh -N --pep8
[testenv:coverage]