summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-03-07 04:25:19 +0000
committerJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-03-07 04:25:19 +0000
commitcede470913db51a4a086b472db6bcd017fd8e247 (patch)
treeecc8d1db79b78f49ca78781edd9ddbc1e9e3df82
parentd954b11944a32b2465b62396855f249e6d09cdc6 (diff)
downloadnova-cede470913db51a4a086b472db6bcd017fd8e247.tar.gz
nova-cede470913db51a4a086b472db6bcd017fd8e247.tar.xz
nova-cede470913db51a4a086b472db6bcd017fd8e247.zip
Don't use _ for variable name
_ is reserved for gettext use and using _ for variable names can result in runtime failures when trying to lookup string translations Change-Id: I8835142fd19ba5f395ddef959c38167f4144b813
-rw-r--r--nova/network/manager.py2
-rw-r--r--nova/tests/test_misc.py2
-rw-r--r--nova/virt/fake.py2
-rw-r--r--nova/virt/vmwareapi_conn.py2
-rw-r--r--nova/virt/xenapi/fake.py2
-rw-r--r--nova/virt/xenapi/pool.py2
-rw-r--r--nova/virt/xenapi_conn.py4
7 files changed, 8 insertions, 8 deletions
diff --git a/nova/network/manager.py b/nova/network/manager.py
index 2fede9d81..407255a40 100644
--- a/nova/network/manager.py
+++ b/nova/network/manager.py
@@ -1111,7 +1111,7 @@ class NetworkManager(manager.SchedulerDependentManager):
'network_id': network_id,
'uuid': str(utils.gen_uuid())}
# try FLAG times to create a vif record with a unique mac_address
- for _ in xrange(FLAGS.create_unique_mac_address_attempts):
+ for i in xrange(FLAGS.create_unique_mac_address_attempts):
try:
return self.db.virtual_interface_create(context, vif)
except exception.VirtualInterfaceCreateException:
diff --git a/nova/tests/test_misc.py b/nova/tests/test_misc.py
index 514135244..0baf38236 100644
--- a/nova/tests/test_misc.py
+++ b/nova/tests/test_misc.py
@@ -147,7 +147,7 @@ class LockTestCase(test.TestCase):
self.assertEquals(e.errno, errno.EPIPE)
return
- rfds, _, __ = select.select([rpipe], [], [], 1)
+ rfds, _wfds, _efds = select.select([rpipe], [], [], 1)
self.assertEquals(len(rfds), 0, "The other process, which was"
" supposed to be locked, "
"wrote on its end of the "
diff --git a/nova/virt/fake.py b/nova/virt/fake.py
index aacffb62c..6be69bd4d 100644
--- a/nova/virt/fake.py
+++ b/nova/virt/fake.py
@@ -36,7 +36,7 @@ from nova.virt import driver
LOG = logging.getLogger(__name__)
-def get_connection(_=None):
+def get_connection(_read_only):
# The read_only parameter is ignored.
return FakeConnection.instance()
diff --git a/nova/virt/vmwareapi_conn.py b/nova/virt/vmwareapi_conn.py
index 93cf9b6d2..8259974a3 100644
--- a/nova/virt/vmwareapi_conn.py
+++ b/nova/virt/vmwareapi_conn.py
@@ -95,7 +95,7 @@ class Failure(Exception):
return str(self.details)
-def get_connection(_):
+def get_connection(_read_only):
"""Sets up the ESX host connection."""
host_ip = FLAGS.vmwareapi_host_ip
host_username = FLAGS.vmwareapi_host_username
diff --git a/nova/virt/xenapi/fake.py b/nova/virt/xenapi/fake.py
index 5813133d8..97ca29184 100644
--- a/nova/virt/xenapi/fake.py
+++ b/nova/virt/xenapi/fake.py
@@ -704,7 +704,7 @@ class SessionBase(object):
def _destroy(self, name, params):
self._check_session(params)
self._check_arg_count(params, 2)
- table, _ = name.split('.')
+ table = name.split('.')[0]
ref = params[1]
if ref not in _db_content[table]:
raise Failure(['HANDLE_INVALID', table, ref])
diff --git a/nova/virt/xenapi/pool.py b/nova/virt/xenapi/pool.py
index 5661fa01a..7448ae357 100644
--- a/nova/virt/xenapi/pool.py
+++ b/nova/virt/xenapi/pool.py
@@ -212,5 +212,5 @@ def forward_request(context, request_type, master, aggregate_id,
def swap_xapi_host(url, host_addr):
"""Replace the XenServer address present in 'url' with 'host_addr'."""
temp_url = urlparse.urlparse(url)
- _, sep, port = temp_url.netloc.partition(':')
+ _netloc, sep, port = temp_url.netloc.partition(':')
return url.replace(temp_url.netloc, '%s%s%s' % (host_addr, sep, port))
diff --git a/nova/virt/xenapi_conn.py b/nova/virt/xenapi_conn.py
index ececea2ee..05e77ef0d 100644
--- a/nova/virt/xenapi_conn.py
+++ b/nova/virt/xenapi_conn.py
@@ -153,7 +153,7 @@ FLAGS = flags.FLAGS
FLAGS.register_opts(xenapi_opts)
-def get_connection(_):
+def get_connection(_read_only):
"""Note that XenAPI doesn't have a read-only connection mode, so
the read_only parameter is ignored."""
url = FLAGS.xenapi_connection_url
@@ -536,7 +536,7 @@ class XenAPISession(object):
return url
def _populate_session_pool(self, url, user, pw, exception):
- for _ in xrange(FLAGS.xenapi_connection_concurrent - 1):
+ for i in xrange(FLAGS.xenapi_connection_concurrent - 1):
session = self._create_session(url)
with timeout.Timeout(FLAGS.xenapi_login_timeout, exception):
session.login_with_password(user, pw)