Skip to content

Commit 53fb9e7

Browse files
author
Fernando Ojeda
committed
Fixed hardware credential issue.
1 parent 10c432f commit 53fb9e7

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

SoftLayer/CLI/hardware/credentials.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,5 @@ def cli(env, identifier):
2727
raise exceptions.SoftLayerError("No passwords found in operatingSystem")
2828

2929
for item in instance['operatingSystem']['passwords']:
30-
if 'password' not in item:
31-
raise exceptions.SoftLayerError("No password found in operatingSystem passwords")
32-
else:
33-
table.add_row([item['username'], item['password']])
30+
table.add_row([item.get('username', 'None'), item.get('password', 'None')])
3431
env.fout(table)

tests/CLI/modules/server_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def test_server_credentials_exception_password_not_found(self):
7474
result = self.run_command(['hardware', 'credentials', '12345'])
7575

7676
self.assertEqual(
77-
'No password found in operatingSystem passwords',
77+
'None',
7878
str(result.exception)
7979
)
8080

0 commit comments

Comments
 (0)