Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions SoftLayer/CLI/virt/detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
from SoftLayer.CLI import helpers
from SoftLayer.CLI.virt.storage import get_local_type
from SoftLayer import utils

LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -200,15 +201,3 @@ def _get_security_table(result):
return secgroup_table
else:
return None


def get_local_type(disks):
"""Returns the virtual server local disk type.

:param disks: virtual serve local disks.
"""
disk_type = 'System'
if 'SWAP' in disks['diskImage']['description']:
disk_type = 'Swap'

return disk_type
2 changes: 1 addition & 1 deletion SoftLayer/CLI/virt/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def get_local_type(disks):
:param disks: virtual serve local disks.
"""
disk_type = 'System'
if 'SWAP' in disks['diskImage']['description']:
if 'SWAP' in disks.get('diskImage', {}).get('description', []):
disk_type = 'Swap'

return disk_type