Skip to content
Closed
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
9 changes: 9 additions & 0 deletions SoftLayer/CLI/block/detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,13 @@ def cli(env, volume_id):
replicant_list.append(replicant_table)
table.add_row(['Replicant Volumes', replicant_list])

if block_volume.get('originalVolumeSize'):
duplicate_info = formatting.Table(['Original Volume Name',
block_volume['originalVolumeName']])
duplicate_info.add_row(['Original Volume Size',
block_volume['originalVolumeSize']])
duplicate_info.add_row(['Original Snapshot Name',
block_volume['originalSnapshotName']])
table.add_row(['Duplicate Volume Properties', duplicate_info])

env.fout(table)
9 changes: 9 additions & 0 deletions SoftLayer/CLI/file/detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,13 @@ def cli(env, volume_id):
replicant_list.append(replicant_table)
table.add_row(['Replicant Volumes', replicant_list])

if file_volume.get('originalVolumeSize'):
duplicate_info = formatting.Table(['Original Volume Name',
file_volume['originalVolumeName']])
duplicate_info.add_row(['Original Volume Size',
file_volume['originalVolumeSize']])
duplicate_info.add_row(['Original Snapshot Name',
file_volume['originalSnapshotName']])
table.add_row(['Duplicate Volume Properties', duplicate_info])

env.fout(table)
3 changes: 3 additions & 0 deletions SoftLayer/fixtures/SoftLayer_Network_Storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
'snapshotCapacityGb': '10',
'parentVolume': {'snapshotSizeBytes': 1024},
'osType': {'keyName': 'LINUX'},
'originalSnapshotName': 'test-origin-snapshot-name',
'originalVolumeName': 'test-origin-volume-name',
'originalVolumeSize': '20',
'schedules': [{
'id': 978,
'type': {'keyname': 'SNAPSHOT_WEEKLY'},
Expand Down
3 changes: 3 additions & 0 deletions SoftLayer/managers/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ def get_block_volume_details(self, volume_id, **kwargs):
'storageTierLevel',
'iops',
'lunId',
'originalVolumeName',
'originalSnapshotName',
'originalVolumeSize',
'activeTransactionCount',
'activeTransactions.transactionStatus[friendlyName]',
'replicationPartnerCount',
Expand Down
3 changes: 3 additions & 0 deletions SoftLayer/managers/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ def get_file_volume_details(self, volume_id, **kwargs):
'storageTierLevel',
'iops',
'lunId',
'originalVolumeName',
'originalSnapshotName',
'originalVolumeSize',
'activeTransactionCount',
'activeTransactions.transactionStatus[friendlyName]',
'replicationPartnerCount',
Expand Down
9 changes: 8 additions & 1 deletion tests/CLI/modules/block_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def test_volume_cancel(self):

def test_volume_detail(self):
result = self.run_command(['block', 'volume-detail', '1234'])

self.assert_no_fail(result)
self.assertEqual({
'Username': 'username',
Expand Down Expand Up @@ -94,7 +95,13 @@ def test_volume_detail(self):
{'Replicant ID': 'Target IP', '1785': '10.3.177.84'},
{'Replicant ID': 'Data Center', '1785': 'dal01'},
{'Replicant ID': 'Schedule', '1785': 'REPLICATION_DAILY'},
]]
]],
'Duplicate Volume Properties': [
{'Original Volume Name': 'Original Volume Size',
'test-origin-volume-name': '20'},
{'Original Volume Name': 'Original Snapshot Name',
'test-origin-volume-name': 'test-origin-snapshot-name'}
]
}, json.loads(result.output))

def test_volume_list(self):
Expand Down
8 changes: 7 additions & 1 deletion tests/CLI/modules/file_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,13 @@ def test_volume_detail(self):
{'Replicant ID': 'Target IP', '1785': '10.3.177.84'},
{'Replicant ID': 'Data Center', '1785': 'dal01'},
{'Replicant ID': 'Schedule', '1785': 'REPLICATION_DAILY'},
]]
]],
'Duplicate Volume Properties': [
{'Original Volume Name': 'Original Volume Size',
'test-origin-volume-name': '20'},
{'Original Volume Name': 'Original Snapshot Name',
'test-origin-volume-name': 'test-origin-snapshot-name'}
]
}, json.loads(result.output))

def test_volume_order_performance_iops_not_given(self):
Expand Down
27 changes: 26 additions & 1 deletion tests/managers/block_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,35 @@ def test_get_block_volume_details(self):

self.assertEqual(fixtures.SoftLayer_Network_Storage.getObject, result)

expected_mask = 'id,'\
'username,'\
'password,'\
'capacityGb,'\
'snapshotCapacityGb,'\
'parentVolume.snapshotSizeBytes,'\
'storageType.keyName,'\
'serviceResource.datacenter[name],'\
'serviceResourceBackendIpAddress,'\
'storageTierLevel,'\
'iops,'\
'lunId,'\
'originalVolumeName,'\
'originalSnapshotName,'\
'originalVolumeSize,'\
'activeTransactionCount,'\
'activeTransactions.transactionStatus[friendlyName],'\
'replicationPartnerCount,'\
'replicationStatus,'\
'replicationPartners[id,username,'\
'serviceResourceBackendIpAddress,'\
'serviceResource[datacenter[name]],'\
'replicationSchedule[type[keyname]]]'

self.assert_called_with(
'SoftLayer_Network_Storage',
'getObject',
identifier=100
identifier=100,
mask='mask[%s]' % expected_mask
)

def test_list_block_volumes(self):
Expand Down
29 changes: 28 additions & 1 deletion tests/managers/file_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,37 @@ def test_get_file_volume_details(self):

self.assertEqual(fixtures.SoftLayer_Network_Storage.getObject, result)

expected_mask = 'id,'\
'username,'\
'password,'\
'capacityGb,'\
'bytesUsed,'\
'snapshotCapacityGb,'\
'parentVolume.snapshotSizeBytes,'\
'storageType.keyName,'\
'serviceResource.datacenter[name],'\
'serviceResourceBackendIpAddress,'\
'fileNetworkMountAddress,'\
'storageTierLevel,'\
'iops,'\
'lunId,'\
'originalVolumeName,'\
'originalSnapshotName,'\
'originalVolumeSize,'\
'activeTransactionCount,'\
'activeTransactions.transactionStatus[friendlyName],'\
'replicationPartnerCount,'\
'replicationStatus,'\
'replicationPartners[id,username,'\
'serviceResourceBackendIpAddress,'\
'serviceResource[datacenter[name]],'\
'replicationSchedule[type[keyname]]]'

self.assert_called_with(
'SoftLayer_Network_Storage',
'getObject',
identifier=100)
identifier=100,
mask='mask[%s]' % expected_mask)

def test_get_file_volume_snapshot_list(self):
result = self.file.get_file_volume_snapshot_list(100)
Expand Down