Skip to content

Commit a584217

Browse files
Merge pull request #1576 from caberos/issue1573
Add loadbalancer timeout values
2 parents 6539959 + 994b5c7 commit a584217

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

SoftLayer/CLI/loadbal/detail.py

+25-13
Original file line numberDiff line numberDiff line change
@@ -39,32 +39,44 @@ def lbaas_table(this_lb):
3939
listener_table, pools = get_listener_table(this_lb)
4040
table.add_row(['Protocols', listener_table])
4141

42-
member_table = get_member_table(this_lb, pools)
43-
table.add_row(['Members', member_table])
44-
45-
hp_table = get_hp_table(this_lb)
46-
table.add_row(['Health Checks', hp_table])
47-
48-
l7pool_table = get_l7pool_table(this_lb)
49-
table.add_row(['L7 Pools', l7pool_table])
50-
51-
ssl_table = get_ssl_table(this_lb)
52-
table.add_row(['Ciphers', ssl_table])
42+
if pools.get('members') is not None:
43+
member_table = get_member_table(this_lb, pools)
44+
table.add_row(['Members', member_table])
45+
else:
46+
table.add_row(['Members', "Not Found"])
47+
48+
if this_lb.get('healthMonitors') != []:
49+
hp_table = get_hp_table(this_lb)
50+
table.add_row(['Health Checks', hp_table])
51+
else:
52+
table.add_row(['Health Checks', "Not Found"])
53+
54+
if this_lb.get('l7Pools') != []:
55+
l7pool_table = get_l7pool_table(this_lb)
56+
table.add_row(['L7 Pools', l7pool_table])
57+
else:
58+
table.add_row(['L7 Pools', "Not Found"])
59+
60+
if this_lb.get('sslCiphers') != []:
61+
ssl_table = get_ssl_table(this_lb)
62+
table.add_row(['Ciphers', ssl_table])
63+
else:
64+
table.add_row(['Ciphers', "Not Found"])
5365

5466
return table
5567

5668

5769
def get_hp_table(this_lb):
5870
"""Generates a table from a list of LBaaS devices"""
5971
# https://sldn.softlayer.com/reference/datatypes/SoftLayer_Network_LBaaS_HealthMonitor/
60-
hp_table = formatting.Table(['UUID', 'Interval', 'Retries', 'Type', 'Timeout', 'Modify', 'Active'])
72+
hp_table = formatting.Table(['UUID', 'Interval', 'Retries', 'Type', 'ServerTimeout ', 'Modify', 'Active'])
6173
for health in this_lb.get('healthMonitors', []):
6274
hp_table.add_row([
6375
health.get('uuid'),
6476
health.get('interval'),
6577
health.get('maxRetries'),
6678
health.get('monitorType'),
67-
health.get('timeout'),
79+
health.get('serverTimeout'),
6880
utils.clean_time(health.get('modifyDate')),
6981
health.get('provisioningStatus')
7082
])

0 commit comments

Comments
 (0)