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:
Melissa Kam 2017-07-07 11:19:11 -05:00
parent fc7a6d0a6e
commit 8a182302ee

View File

@ -246,7 +246,9 @@ python <<EOL
import yaml
with open('haproxy_config.yml') as f:
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')
if isinstance(y, int):
print y