Commit fa331311 authored by Sigmund Augdal's avatar Sigmund Augdal

Break some over-long lines

parent 747bd3d9
......@@ -106,7 +106,8 @@ class Generator(object):
def generate_all(self):
hosts, index = self.get_hosts()
total_range = self.range[1] - self.range[0] + 1
dynamic_hosts = [host for host in hosts if parse_ip(host) >= self.range[0] and parse_ip(host) <= self.range[1]]
dynamic_hosts = [host for host in hosts if
parse_ip(host) >= self.range[0] and parse_ip(host) <= self.range[1]]
if total_range - len(dynamic_hosts) < 2:
logging.warn("Running very low on addresses. Forcing extra cleanup")
# We're really close to running out of addresses, check if some VMs has been deleted
......@@ -126,7 +127,8 @@ class Generator(object):
def main(self):
index = self.generate_all()
while True:
data = self.etcd_client.read("/nova/iaas/instances", recursive=True, wait=True, waitIndex=index+1, timeout=0)
data = self.etcd_client.read("/nova/iaas/instances", recursive=True, wait=True,
waitIndex=index+1, timeout=0)
logging.debug("new config index %d", data.etcd_index) # pylint: disable=E1101
time.sleep(1)
index = self.generate_all()
......
......@@ -195,7 +195,8 @@ class Generator(object):
old_groups = old_groups.split("\n")
old_groups = [group for group in old_groups if group]
if len(old_groups) >= 1:
self.generation = max((int(group.split("_")[-1]) for group in old_groups if "_" in group)) + 1
self.generation = max((int(group.split("_")[-1]) for group in old_groups
if "_" in group)) + 1
else:
self.generation = 0
else:
......@@ -273,7 +274,8 @@ class Generator(object):
" generated_ip6tables")
return
while True:
data = self.etcd_client.read("/nova/iaas", recursive=True, wait=True, waitIndex=index+1, timeout=0)
data = self.etcd_client.read("/nova/iaas", recursive=True, wait=True,
waitIndex=index+1, timeout=0)
index = data.modifiedIndex # pylint: disable=E1103,E1101
key = data.key # pylint: disable=E1101,E1103
if not key.startswith("/nova/iaas/instances") and not \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment