55
66import SoftLayer
77from SoftLayer .CLI import environment
8+ from SoftLayer .CLI import exceptions
89
910
1011@click .command (cls = SoftLayer .CLI .command .SLCommand , )
@@ -24,20 +25,20 @@ def cli(env, identifier, hardware, virtual, dedicated):
2425 if hardware :
2526 result = mgr .remove_hardware_access (identifier , hardware )
2627 if result :
27- click .secho ("Remove to access to hardware: %s" % hardware , fg = 'green' )
28+ click .secho (f"Removed access to hardware: { hardware } ." , fg = 'green' )
2829
2930 if virtual :
3031 result = mgr .remove_virtual_access (identifier , virtual )
3132 if result :
32- click .secho ("Remove to access to virtual guest: %s" % virtual , fg = 'green' )
33+ click .secho (f"Removed access to virtual guest: { virtual } " , fg = 'green' )
3334
3435 if dedicated :
3536 result = mgr .remove_dedicated_access (identifier , dedicated )
3637 if result :
37- click .secho ("Remove to access to dedicated host: %s" % dedicated , fg = 'green' )
38+ click .secho (f"Removed access to dedicated host: { dedicated } " , fg = 'green' )
3839
3940 if not result :
40- raise SoftLayer . exceptions .SoftLayerError ( 'You need argument a hardware, virtual or dedicated identifier .\n '
41- 'E.g slcli user remove-access 123456 --hardware 91803794\n '
42- ' slcli user remove-access 123456 --dedicated 91803793\n '
43- ' slcli user remove-access 123456 --virtual 91803792' )
41+ raise exceptions .CLIAbort ( 'A device option is required .\n '
42+ 'E.g slcli user remove-access 123456 --hardware 91803794\n '
43+ ' slcli user remove-access 123456 --dedicated 91803793\n '
44+ ' slcli user remove-access 123456 --virtual 91803792' )
0 commit comments