@@ -39,32 +39,44 @@ def lbaas_table(this_lb):
39
39
listener_table , pools = get_listener_table (this_lb )
40
40
table .add_row (['Protocols' , listener_table ])
41
41
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" ])
53
65
54
66
return table
55
67
56
68
57
69
def get_hp_table (this_lb ):
58
70
"""Generates a table from a list of LBaaS devices"""
59
71
# 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' ])
61
73
for health in this_lb .get ('healthMonitors' , []):
62
74
hp_table .add_row ([
63
75
health .get ('uuid' ),
64
76
health .get ('interval' ),
65
77
health .get ('maxRetries' ),
66
78
health .get ('monitorType' ),
67
- health .get ('timeout ' ),
79
+ health .get ('serverTimeout ' ),
68
80
utils .clean_time (health .get ('modifyDate' )),
69
81
health .get ('provisioningStatus' )
70
82
])
0 commit comments