Improved dir ips string
This commit is contained in:
parent
c294e408dd
commit
c3c8e37fcd
@ -78,18 +78,15 @@ class PGDirContext(context.NeutronContext):
|
|||||||
fallback=get_host_ip(unit_get('private-address')))))
|
fallback=get_host_ip(unit_get('private-address')))))
|
||||||
pg_dir_ips = sorted(pg_dir_ips)
|
pg_dir_ips = sorted(pg_dir_ips)
|
||||||
pg_ctxt['director_ips'] = pg_dir_ips
|
pg_ctxt['director_ips'] = pg_dir_ips
|
||||||
pg_dir_ips_string = ''
|
dir_count = len(pg_dir_ips)
|
||||||
single_ip = True
|
pg_ctxt['director_ips_string'] = (str(pg_dir_ips[0]) + ',' +
|
||||||
for ip in pg_dir_ips:
|
str(pg_dir_ips[1]) + ',' +
|
||||||
if single_ip:
|
str(pg_dir_ips[2])
|
||||||
pg_dir_ips_string = str(ip)
|
if dir_count == 3 else
|
||||||
single_ip = False
|
str(pg_dir_ips[0]))
|
||||||
else:
|
PG_VIP = conf['plumgrid-virtual-ip']
|
||||||
pg_dir_ips_string = pg_dir_ips_string + ',' + str(ip)
|
|
||||||
pg_ctxt['director_ips_string'] = pg_dir_ips_string
|
|
||||||
PG_VIP = config('plumgrid-virtual-ip')
|
|
||||||
if is_ip(PG_VIP):
|
if is_ip(PG_VIP):
|
||||||
pg_ctxt['virtual_ip'] = conf['plumgrid-virtual-ip']
|
pg_ctxt['virtual_ip'] = PG_VIP
|
||||||
else:
|
else:
|
||||||
raise ValueError('Invalid PLUMgrid Virtual IP Provided')
|
raise ValueError('Invalid PLUMgrid Virtual IP Provided')
|
||||||
unit_hostname = gethostname()
|
unit_hostname = gethostname()
|
||||||
|
Loading…
Reference in New Issue
Block a user