Support older versions for getting service ports
Kilo and Liberty have a different name for the haproxy services than newer versions. Change-Id: I070eb22cc219451f42c436fa31e4db33fa79a8fe
This commit is contained in:
parent
fc7a6d0a6e
commit
8a182302ee
@ -246,7 +246,9 @@ python <<EOL
|
|||||||
import yaml
|
import yaml
|
||||||
with open('haproxy_config.yml') as f:
|
with open('haproxy_config.yml') as f:
|
||||||
x = yaml.safe_load(f.read())
|
x = yaml.safe_load(f.read())
|
||||||
for i in x['haproxy_default_services']:
|
haproxy_services = (x.get('haproxy_default_services')
|
||||||
|
or x.get('haproxy_service_configs'))
|
||||||
|
for i in haproxy_services:
|
||||||
y = i['service'].get('haproxy_port')
|
y = i['service'].get('haproxy_port')
|
||||||
if isinstance(y, int):
|
if isinstance(y, int):
|
||||||
print y
|
print y
|
||||||
|
Loading…
Reference in New Issue
Block a user