Skip to content

Commit d19cc48

Browse files
Merge pull request #1794 from caberos/issue1793
An error is displaying for volume with replica in slcli for Active pr…
2 parents 9504d8f + 6f9a9dd commit d19cc48

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

SoftLayer/CLI/block/detail.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ def cli(env, volume_id):
8080
table.add_row(['Replication Status', "%s"
8181
% block_volume['replicationStatus']])
8282

83-
replicant_list = []
8483
for replicant in block_volume['replicationPartners']:
85-
replicant_table = formatting.Table(['Replicant ID',
86-
replicant['id']])
84+
replicant_table = formatting.Table(['Name',
85+
'Value'])
86+
replicant_table.add_row(['Replicant Id', replicant['id']])
8787
replicant_table.add_row([
8888
'Volume Name',
8989
utils.lookup(replicant, 'username')])
@@ -98,8 +98,7 @@ def cli(env, volume_id):
9898
'Schedule',
9999
utils.lookup(replicant,
100100
'replicationSchedule', 'type', 'keyname')])
101-
replicant_list.append(replicant_table)
102-
table.add_row(['Replicant Volumes', replicant_list])
101+
table.add_row(['Replicant Volumes', replicant_table])
103102

104103
if block_volume.get('originalVolumeSize'):
105104
original_volume_info = formatting.Table(['Property', 'Value'])

tests/CLI/modules/block_tests.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def test_volume_detail(self):
6767
'LUN Id': '2',
6868
'Notes': "{'status': 'available'}",
6969
'Endurance Tier': 'READHEAVY_TIER',
70-
'IOPs': 1000,
70+
'IOPs': 1000.0,
7171
'Snapshot Capacity (GB)': '10',
7272
'Snapshot Used (Bytes)': 1024,
7373
'Capacity (GB)': '20GB',
@@ -80,17 +80,12 @@ def test_volume_detail(self):
8080
'Replicant Count': '1',
8181
'Replication Status': 'Replicant Volume Provisioning '
8282
'has completed.',
83-
'Replicant Volumes': [[
84-
{'Replicant ID': 'Volume Name', '1784': 'TEST_REP_1'},
85-
{'Replicant ID': 'Target IP', '1784': '10.3.174.79'},
86-
{'Replicant ID': 'Data Center', '1784': 'wdc01'},
87-
{'Replicant ID': 'Schedule', '1784': 'REPLICATION_HOURLY'},
88-
], [
89-
{'Replicant ID': 'Volume Name', '1785': 'TEST_REP_2'},
90-
{'Replicant ID': 'Target IP', '1785': '10.3.177.84'},
91-
{'Replicant ID': 'Data Center', '1785': 'dal01'},
92-
{'Replicant ID': 'Schedule', '1785': 'REPLICATION_DAILY'},
93-
]],
83+
'Replicant Volumes': [
84+
{'Name': 'Replicant Id', 'Value': 1785},
85+
{'Name': 'Volume Name', 'Value': 'TEST_REP_2'},
86+
{'Name': 'Target IP', 'Value': '10.3.177.84'},
87+
{'Name': 'Data Center', 'Value': 'dal01'},
88+
{'Name': 'Schedule', 'Value': 'REPLICATION_DAILY'}],
9489
'Original Volume Properties': [
9590
{'Property': 'Original Volume Size',
9691
'Value': '20'},

0 commit comments

Comments
 (0)