summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Tran <jtran@attinteractive.com>2011-08-04 18:52:15 -0700
committerJohn Tran <jtran@attinteractive.com>2011-08-04 18:52:15 -0700
commitb557b6366b21a0d3795369785037ee29c8cef377 (patch)
tree1eb6bc71215a1343a721098d2926a9a2f1af891e
parent38eb72be5f15731ba34a7dc0f8a28aa0fb63ea90 (diff)
fix pep8 issues
-rw-r--r--nova/network/manager.py14
-rw-r--r--nova/tests/test_network.py5
2 files changed, 12 insertions, 7 deletions
diff --git a/nova/network/manager.py b/nova/network/manager.py
index 0bb107268..1b92effb2 100644
--- a/nova/network/manager.py
+++ b/nova/network/manager.py
@@ -647,7 +647,8 @@ class NetworkManager(manager.SchedulerDependentManager):
all_req_nets = []
if num_networks == 1:
if adjusted_cidr in used_supernets:
- msg = "requested cidr (%s) conflicts with existing smaller cidr"
+ msg = "requested cidr (%s) conflicts with existing smaller" \
+ " cidr"
raise ValueError(_(msg % str(adjusted_cidr)))
else:
all_req_nets.append(adjusted_cidr)
@@ -656,8 +657,9 @@ class NetworkManager(manager.SchedulerDependentManager):
next_cidr = adjusted_cidr
for index in range(num_networks):
if next_cidr.first > req_net.last:
- msg = "Not enough subnets avail to satisfy requested num_net" \
- "works - some subnets in requested range already in use"
+ msg = "Not enough subnets avail to satisfy requested " \
+ "num_net works - some subnets in requested range" \
+ " already in use"
raise ValueError(_(msg))
while True:
if next_cidr in used_cidrs:
@@ -671,9 +673,11 @@ class NetworkManager(manager.SchedulerDependentManager):
next_cidr = next_cidr.next()
break
all_req_nets = sorted(list(set(all_req_nets)))
- # after splitting ensure there were enough to satisfy the num_networks
+ # after splitting ensure there were enough to satisfy the
+ # num_networks
if len(all_req_nets) < num_networks:
- msg = "Not enough subnets avail to satisfy requested num_networks"
+ msg = "Not enough subnets avail to satisfy requested " \
+ "num_networks"
raise ValueError(_(msg))
return all_req_nets
diff --git a/nova/tests/test_network.py b/nova/tests/test_network.py
index b4c5a7584..8c84ea938 100644
--- a/nova/tests/test_network.py
+++ b/nova/tests/test_network.py
@@ -367,8 +367,9 @@ class CommonNetworkTestCase(test.TestCase):
manager.db.network_get_all(ctxt).AndReturn(in_use)
self.mox.ReplayAll()
args = [None, '192.168.2.0/24', 3, 64]
- # ValueError: Not enough subnets avail to satisfy requested num_networks
- # - some subnets in requested range already in use
+ # ValueError: Not enough subnets avail to satisfy requested num_
+ # networks - some subnets in requested range already
+ # in use
self.assertRaises(ValueError, manager._validate_cidrs, *args)
def test__validate_cidrs_one_in_use(self):