Skip to content

Commit 197c675

Browse files
Merge pull request #1435 from caberos/issue1434
Add preset datatype in `slcli virtual detail`
2 parents cc46a13 + 60a6feb commit 197c675

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed

SoftLayer/CLI/virt/detail.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ def cli(env, identifier, passwords=False, price=False):
6969
table.add_row(['transient', result.get('transientGuestFlag', False)])
7070
table.add_row(['created', result['createDate']])
7171
table.add_row(['modified', result['modifyDate']])
72+
table.add_row(['preset', utils.lookup(result, 'billingItem',
73+
'orderItem',
74+
'preset',
75+
'keyName') or '-'])
7276

7377
table.add_row(_get_owner_row(result))
7478
table.add_row(_get_vlan_table(result))

SoftLayer/fixtures/SoftLayer_Virtual_Guest.py

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
'userRecord': {
2929
'username': 'chechu',
3030
}
31-
}
31+
},
32+
'preset': {'keyName': 'B1_8X16X100'}
3233
}
3334
},
3435
'datacenter': {'id': 50, 'name': 'TEST00',
@@ -480,30 +481,30 @@
480481
"categoryCode": "guest_disk0",
481482
"id": 81
482483
}}, {
483-
"description": "250 GB (SAN)",
484-
"attributes": [
485-
{
486-
"id": 198,
487-
"attributeTypeKeyName": "SAN_DISK"
488-
}],
489-
"itemCategory": {
490-
"categoryCode": "guest_disk0",
491-
"id": 89
492-
}}],
484+
"description": "250 GB (SAN)",
485+
"attributes": [
486+
{
487+
"id": 198,
488+
"attributeTypeKeyName": "SAN_DISK"
489+
}],
490+
"itemCategory": {
491+
"categoryCode": "guest_disk0",
492+
"id": 89
493+
}}],
493494
'guest_core': [{
494495
"description": "4 x 2.0 GHz or higher Cores (Dedicated)",
495496
"attributes": [],
496497
"itemCategory": {
497498
"categoryCode": "guest_core",
498499
"id": 80
499500
}},
500-
{
501-
"description": "8 x 2.0 GHz or higher Cores",
502-
"attributes": [],
503-
"itemCategory": {
504-
"categoryCode": "guest_core",
505-
"id": 90
506-
}}]
501+
{
502+
"description": "8 x 2.0 GHz or higher Cores",
503+
"attributes": [],
504+
"itemCategory": {
505+
"categoryCode": "guest_core",
506+
"id": 90
507+
}}]
507508
}
508509

509510
getReverseDomainRecords = [{

0 commit comments

Comments
 (0)