Skip to content

Commit 373a53a

Browse files
Merge pull request #1781 from caberos/issue1776
fix the hw credential error
2 parents 6622aa7 + 649f872 commit 373a53a

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

SoftLayer/CLI/hardware/credentials.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ def cli(env, identifier):
2929
for credentials in item['passwords']:
3030
table.add_row([credentials.get('username', 'None'),
3131
credentials.get('password', 'None'),
32-
item['softwareLicense']['softwareDescription']['referenceCode'],
32+
item['softwareLicense']['softwareDescription']['name'],
3333
item['softwareLicense']['softwareDescription']['version']])
3434
env.fout(table)

SoftLayer/managers/hardware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def get_hardware(self, hardware_id, **kwargs):
260260
name,
261261
version,
262262
referenceCode]],
263-
passwords[username,password]],'''
263+
passwords[id,username,password]],'''
264264
'billingItem['
265265
'id,nextInvoiceTotalRecurringAmount,'
266266
'nextInvoiceChildren[nextInvoiceTotalRecurringAmount],'

tests/CLI/modules/server_tests.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,16 @@ def test_server_credentials(self):
4646
'softwareDescription':
4747
{
4848
'referenceCode': 'CENTOS_7_64',
49-
'version': '7.8 - 64'}}}]
49+
'version': '7.8 - 64',
50+
'name': 'Centos'
51+
}}}]
5052
}
5153
result = self.run_command(['hardware', 'credentials', '12345'])
5254

5355
self.assert_no_fail(result)
5456
self.assertEqual(json.loads(result.output), [
5557
{'Password': 'abc123',
56-
'Software': 'CENTOS_7_64',
58+
'Software': 'Centos',
5759
'Username': 'root',
5860
'Version': '7.8 - 64'}
5961
])
@@ -93,7 +95,7 @@ def test_server_credentials_exception_password_not_found(self):
9395
"passwords": [{}],
9496
"softwareLicense": {
9597
"softwareDescription": {
96-
"referenceCode": None,
98+
"name": None,
9799
"version": None
98100
}
99101
}

0 commit comments

Comments
 (0)