Skip to content

An error is displaying for volume with replica in slcli for Active pr… #1794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 30, 2022
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
9 changes: 4 additions & 5 deletions SoftLayer/CLI/block/detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ def cli(env, volume_id):
table.add_row(['Replication Status', "%s"
% block_volume['replicationStatus']])

replicant_list = []
for replicant in block_volume['replicationPartners']:
replicant_table = formatting.Table(['Replicant ID',
replicant['id']])
replicant_table = formatting.Table(['Name',
'Value'])
replicant_table.add_row(['Replicant Id', replicant['id']])
replicant_table.add_row([
'Volume Name',
utils.lookup(replicant, 'username')])
Expand All @@ -98,8 +98,7 @@ def cli(env, volume_id):
'Schedule',
utils.lookup(replicant,
'replicationSchedule', 'type', 'keyname')])
replicant_list.append(replicant_table)
table.add_row(['Replicant Volumes', replicant_list])
table.add_row(['Replicant Volumes', replicant_table])

if block_volume.get('originalVolumeSize'):
original_volume_info = formatting.Table(['Property', 'Value'])
Expand Down
19 changes: 7 additions & 12 deletions tests/CLI/modules/block_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_volume_detail(self):
'LUN Id': '2',
'Notes': "{'status': 'available'}",
'Endurance Tier': 'READHEAVY_TIER',
'IOPs': 1000,
'IOPs': 1000.0,
'Snapshot Capacity (GB)': '10',
'Snapshot Used (Bytes)': 1024,
'Capacity (GB)': '20GB',
Expand All @@ -80,17 +80,12 @@ def test_volume_detail(self):
'Replicant Count': '1',
'Replication Status': 'Replicant Volume Provisioning '
'has completed.',
'Replicant Volumes': [[
{'Replicant ID': 'Volume Name', '1784': 'TEST_REP_1'},
{'Replicant ID': 'Target IP', '1784': '10.3.174.79'},
{'Replicant ID': 'Data Center', '1784': 'wdc01'},
{'Replicant ID': 'Schedule', '1784': 'REPLICATION_HOURLY'},
], [
{'Replicant ID': 'Volume Name', '1785': 'TEST_REP_2'},
{'Replicant ID': 'Target IP', '1785': '10.3.177.84'},
{'Replicant ID': 'Data Center', '1785': 'dal01'},
{'Replicant ID': 'Schedule', '1785': 'REPLICATION_DAILY'},
]],
'Replicant Volumes': [
{'Name': 'Replicant Id', 'Value': 1785},
{'Name': 'Volume Name', 'Value': 'TEST_REP_2'},
{'Name': 'Target IP', 'Value': '10.3.177.84'},
{'Name': 'Data Center', 'Value': 'dal01'},
{'Name': 'Schedule', 'Value': 'REPLICATION_DAILY'}],
'Original Volume Properties': [
{'Property': 'Original Volume Size',
'Value': '20'},
Expand Down