Skip to content

Commit f0a6454

Browse files
committed
Review the change
1 parent 95f4f2c commit f0a6454

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

SoftLayer/CLI/block/refresh.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Refresh a dependent duplicate volume with a snapshot from its parent."""
1+
"""Refresh a duplicate volume with a snapshot from its parent."""
22
# :license: MIT, see LICENSE for more details.
33

44
import click
@@ -11,8 +11,9 @@
1111
@click.argument('snapshot_id')
1212
@environment.pass_env
1313
def cli(env, volume_id, snapshot_id):
14-
""""Refresh a dependent duplicate volume with a snapshot from its parent."""
14+
""""Refresh a duplicate volume with a snapshot from its parent."""
1515
block_manager = SoftLayer.BlockStorageManager(env.client)
16-
resp = block_manager.refresh_dep_dupe(volume_id, snapshot_id)
16+
resp = block_manager.refresh_dupe(volume_id, snapshot_id) #remove dep_ in refresh_dep_dupe
1717

1818
click.echo(resp)
19+

SoftLayer/fixtures/SoftLayer_Network_Storage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@
234234
'provisionedCount': 100
235235
}
236236

237-
refreshDependentDuplicate = {
238-
'dependentDuplicate': 1
237+
refreshDuplicate = { #remove Dependent from refreshDependentDuplicate
238+
'DependentDuplicate': 1
239239
}
240240

241241
convertCloneDependentToIndependent = {

SoftLayer/managers/storage.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,13 +415,15 @@ def cancel_volume(self, volume_id, reason='No longer needed', immediate=False):
415415

416416
return self.client.call('SoftLayer_Billing_Item', 'cancelItem', immediate, True, reason, id=billing_item_id)
417417

418-
def refresh_dep_dupe(self, volume_id, snapshot_id):
419-
""""Refresh a dependent duplicate volume with a snapshot from its parent.
418+
def refresh_dupe(self, volume_id, snapshot_id): #remove dep
419+
""""Refresh a duplicate volume with a snapshot from its parent.
420420
421421
:param integer volume_id: The id of the volume
422422
:param integer snapshot_id: The id of the snapshot
423423
"""
424-
return self.client.call('Network_Storage', 'refreshDependentDuplicate', snapshot_id, id=volume_id)
424+
return self.client.call('Network_Storage', 'refreshDuplicate', snapshot_id, id=volume_id) #remove Dependent
425+
426+
425427

426428
def convert_dep_dupe(self, volume_id):
427429
"""Convert a dependent duplicate volume to an independent volume.

tests/CLI/modules/block_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ def test_volume_limit(self, list_mock):
717717
result = self.run_command(['block', 'volume-limits'])
718718
self.assert_no_fail(result)
719719

720-
def test_dep_dupe_refresh(self):
720+
def test_dupe_refresh(self): #remove _dep in test_dep_dupe_refresh
721721
result = self.run_command(['block', 'volume-refresh', '102', '103'])
722722

723723
self.assert_no_fail(result)

tests/managers/block_tests.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,13 +1043,13 @@ def test_get_ids_from_username_empty(self):
10431043
self.assert_called_with('SoftLayer_Account', 'getIscsiNetworkStorage')
10441044
self.assertEqual([], result)
10451045

1046-
def test_refresh_block_depdupe(self):
1047-
result = self.block.refresh_dep_dupe(123, snapshot_id=321)
1048-
self.assertEqual(SoftLayer_Network_Storage.refreshDependentDuplicate, result)
1046+
def test_refresh_block_dupe(self): #remove dep in block_depdupe
1047+
result = self.block.refresh_dupe(123, snapshot_id=321) #remove dep in refresh_dep_dupe
1048+
self.assertEqual(SoftLayer_Network_Storage.refreshDuplicate, result) #remove Dependent in refreshDependentDuplicate
10491049

10501050
self.assert_called_with(
10511051
'SoftLayer_Network_Storage',
1052-
'refreshDependentDuplicate',
1052+
'refreshDuplicate', #remove Dependent in refreshDependentDuplicate
10531053
identifier=123
10541054
)
10551055

0 commit comments

Comments
 (0)