Skip to content

Commit ba95504

Browse files
author
Brian Flores
committed
added new command, unit tests and updated core test to work with commands that name starts with other command names
1 parent a45257a commit ba95504

20 files changed

+107
-125
lines changed

SoftLayer/CLI/environment.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ def list_commands(self, *path):
138138

139139
# offset is used to exclude the path that the caller requested.
140140
offset = len(path_str) + 1 if path_str else 0
141-
commands.append(command[offset:])
141+
if ':' not in command[offset:]:
142+
commands.append(command[offset:])
142143

143144
return sorted(commands)
144145

SoftLayer/CLI/routes.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -331,19 +331,17 @@
331331
'SoftLayer.CLI.securitygroup.interface:remove'),
332332
('securitygroup:event-log', 'SoftLayer.CLI.securitygroup.event_log:get_by_request_id'),
333333

334-
('sshkey', 'SoftLayer.CLI.sshkey'),
335-
('sshkey:add', 'SoftLayer.CLI.sshkey.add:cli'),
336-
('sshkey:remove', 'SoftLayer.CLI.sshkey.remove:cli'),
337-
('sshkey:edit', 'SoftLayer.CLI.sshkey.edit:cli'),
338-
('sshkey:list', 'SoftLayer.CLI.sshkey.list:cli'),
339-
('sshkey:print', 'SoftLayer.CLI.sshkey.print:cli'),
340-
341-
('ssl', 'SoftLayer.CLI.ssl'),
342-
('ssl:add', 'SoftLayer.CLI.ssl.add:cli'),
343-
('ssl:download', 'SoftLayer.CLI.ssl.download:cli'),
344-
('ssl:edit', 'SoftLayer.CLI.ssl.edit:cli'),
345-
('ssl:list', 'SoftLayer.CLI.ssl.list:cli'),
346-
('ssl:remove', 'SoftLayer.CLI.ssl.remove:cli'),
334+
('security', 'SoftLayer.CLI.security'),
335+
('security:sshkey-add', 'SoftLayer.CLI.security.sshkey_add:cli'),
336+
('security:sshkey-remove', 'SoftLayer.CLI.security.sshkey_remove:cli'),
337+
('security:sshkey-edit', 'SoftLayer.CLI.security.sshkey_edit:cli'),
338+
('security:sshkey-list', 'SoftLayer.CLI.security.sshkey_list:cli'),
339+
('security:sshkey-print', 'SoftLayer.CLI.security.sshkey_print:cli'),
340+
('security:cert-add', 'SoftLayer.CLI.security.cert_add:cli'),
341+
('security:cert-download', 'SoftLayer.CLI.security.cert_download:cli'),
342+
('security:cert-edit', 'SoftLayer.CLI.security.cert_edit:cli'),
343+
('security:cert-list', 'SoftLayer.CLI.security.cert_list:cli'),
344+
('security:cert-remove', 'SoftLayer.CLI.security.cert_remove:cli'),
347345

348346
('subnet', 'SoftLayer.CLI.subnet'),
349347
('subnet:cancel', 'SoftLayer.CLI.subnet.cancel:cli'),

SoftLayer/CLI/security/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
"""SSH Keys and SSL Certificates."""
2+
# :license: MIT, see LICENSE for more details.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)