Skip to content

Commit 2ab11f4

Browse files
Merge pull request #1303 from ATGE/issues1298
#1298 Fix Unhandled exception in CLI - vs detail
2 parents 04c0bec + cda861a commit 2ab11f4

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

SoftLayer/CLI/virt/detail.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from SoftLayer.CLI import environment
1010
from SoftLayer.CLI import formatting
1111
from SoftLayer.CLI import helpers
12+
from SoftLayer.CLI.virt.storage import get_local_type
1213
from SoftLayer import utils
1314

1415
LOGGER = logging.getLogger(__name__)
@@ -200,15 +201,3 @@ def _get_security_table(result):
200201
return secgroup_table
201202
else:
202203
return None
203-
204-
205-
def get_local_type(disks):
206-
"""Returns the virtual server local disk type.
207-
208-
:param disks: virtual serve local disks.
209-
"""
210-
disk_type = 'System'
211-
if 'SWAP' in disks['diskImage']['description']:
212-
disk_type = 'Swap'
213-
214-
return disk_type

SoftLayer/CLI/virt/storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def get_local_type(disks):
6767
:param disks: virtual serve local disks.
6868
"""
6969
disk_type = 'System'
70-
if 'SWAP' in disks['diskImage']['description']:
70+
if 'SWAP' in disks.get('diskImage', {}).get('description', []):
7171
disk_type = 'Swap'
7272

7373
return disk_type

0 commit comments

Comments
 (0)