1515
1616from SoftLayer import NetworkManager
1717from SoftLayer .CLI import (
18- CLIRunnable , Table , FormattedItem , confirm , no_going_back )
18+ CLIRunnable , Table , FormattedItem , confirm , no_going_back , resolve_id )
1919from SoftLayer .CLI .helpers import CLIAbort , SequentialOutput
2020
2121
@@ -33,8 +33,9 @@ class GlobalIpAssign(CLIRunnable):
3333
3434 def execute (self , args ):
3535 mgr = NetworkManager (self .client )
36-
37- global_ip_id = mgr .resolve_global_ip_ids (args .get ('<identifier>' ))
36+ global_ip_id = resolve_id (mgr .resolve_global_ip_ids ,
37+ args .get ('<identifier>' ),
38+ name = 'global ip' )
3839 if not global_ip_id :
3940 raise CLIAbort ("Unable to find global IP record for " +
4041 args ['<identifier>' ])
@@ -53,7 +54,9 @@ class GlobalIpCancel(CLIRunnable):
5354
5455 def execute (self , args ):
5556 mgr = NetworkManager (self .client )
56- global_ip_id = mgr .resolve_global_ip_ids (args .get ('<identifier>' ))
57+ global_ip_id = resolve_id (mgr .resolve_global_ip_ids ,
58+ args .get ('<identifier>' ),
59+ name = 'global ip' )(args .get ('<identifier>' ))
5760
5861 if args ['--really' ] or no_going_back (global_ip_id ):
5962 mgr .cancel_global_ip (global_ip_id )
@@ -172,8 +175,9 @@ class GlobalIpUnassign(CLIRunnable):
172175
173176 def execute (self , args ):
174177 mgr = NetworkManager (self .client )
175-
176- global_ip_id = mgr .resolve_global_ip_ids (args .get ('<identifier>' ))
178+ global_ip_id = resolve_id (mgr .resolve_global_ip_ids ,
179+ args .get ('<identifier>' ),
180+ name = 'global ip' )
177181 if not global_ip_id :
178182 raise CLIAbort ("Unable to find global IP record for " +
179183 args ['<identifier>' ])
0 commit comments