@@ -57,7 +57,8 @@ def parse_args():
5757 help = "display details information" )
5858 parser .add_argument ('-a' , '--all' ,
5959 action = 'store_true' ,
60- help = 'list all of the public IP addresses for the instance.' )
60+ # help='list all of the public IP addresses for the instance.')
61+ help = argparse .SUPPRESS )
6162 parser .add_argument ('-s' , '--sourceip' ,
6263 action = 'store' ,
6364 default = "0.0.0.0" ,
@@ -92,10 +93,10 @@ def _display_ip_list(ip_list, displayALL, outputMode, displayDetails):
9293 displayDetails : display detailed information ?
9394 """
9495
96+ _sorted_list_of_pubips = sorted (ip_list , key = lambda ip : ip ['primary' ], reverse = True )
9597 if displayALL :
9698 _ip_list_to_display = ip_list
9799 else :
98- # We assume that primary is the first one and we want to display only it
99100 _ip_list_to_display = ip_list [:1 ]
100101
101102 _collen = {'ipaddress' : len ('IP Address' ),
@@ -136,7 +137,7 @@ def _display_ip_list(ip_list, displayALL, outputMode, displayDetails):
136137
137138 _printer = printerKlass (title = _title , columns = _columns )
138139 _printer .printHeader ()
139- _sorted_list_of_pubips = sorted (_ip_list_to_display , key = lambda ip : ip ['primary' ], reverse = True )
140+ # _sorted_list_of_pubips = sorted(_ip_list_to_display, key=lambda ip: ip['primary'], reverse=True)
140141 for _ip in _sorted_list_of_pubips :
141142 _printer .printRow (_ip )
142143 _printer .printFooter ()
@@ -201,7 +202,7 @@ def main():
201202 'vnic_ocid' : v .get_ocid ()} for v in _instance .all_vnics () if v .get_public_ip ()]
202203 stun_log .debug ('%s ips retrieved from sdk information' , len (_all_p_ips ))
203204 if len (_all_p_ips ) == 0 :
204- stun_log .info ('No public ip addresses found from OCI, falling back to the stun servers.' )
205+ # stun_log.info('No public ip addresses found from OCI, falling back to the stun servers.')
205206 _instance = None
206207 except Exception as e :
207208 stun_log .info ('Instance is missing privileges to collect ip data from OCI, '
@@ -247,7 +248,8 @@ def main():
247248 for ip in _all_p_ips :
248249 print ('%16s' % ip ['ip' ])
249250 else :
250- _display_ip_list (_all_p_ips , args .all , args .output_mode , args .details )
251+ # _display_ip_list(_all_p_ips, args.all, args.output_mode, args.details)
252+ _display_ip_list (_all_p_ips , True , args .output_mode , args .details )
251253
252254 return 0
253255
0 commit comments