Skip to content

Commit f552708

Browse files
author
Samson Yerraguntla
committed
feature/VolumeLimit Address the code style issues
1 parent ae84082 commit f552708

File tree

8 files changed

+25
-29
lines changed

8 files changed

+25
-29
lines changed

SoftLayer/CLI/block/limit.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414

1515

1616
@click.command()
17-
@click.option('--datacenter', '-d', help='Datacenter shortname')
1817
@click.option('--sortby', help='Column to sort by', default='Datacenter')
1918
@environment.pass_env
20-
def cli(env, sortby, datacenter):
19+
def cli(env, sortby):
2120
"""List number of block storage volumes limit per datacenter."""
2221
block_manager = SoftLayer.BlockStorageManager(env.client)
2322
block_volumes = block_manager.list_block_volume_limit()
@@ -29,4 +28,4 @@ def cli(env, sortby, datacenter):
2928
maximum_available_count = volume['maximumAvailableCount']
3029
provisioned_count = volume['provisionedCount']
3130
table.add_row([datacenter_name, maximum_available_count, provisioned_count])
32-
env.fout(table)
31+
env.fout(table)

SoftLayer/CLI/file/limit.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414

1515

1616
@click.command()
17-
@click.option('--datacenter', '-d', help='Datacenter shortname')
1817
@click.option('--sortby', help='Column to sort by', default='Datacenter')
1918
@environment.pass_env
20-
def cli(env, sortby, datacenter):
19+
def cli(env, sortby):
2120
"""List number of block storage volumes limit per datacenter."""
2221
file_manager = SoftLayer.FileStorageManager(env.client)
2322
file_volumes = file_manager.list_file_volume_limit()
@@ -29,4 +28,4 @@ def cli(env, sortby, datacenter):
2928
maximum_available_count = volume['maximumAvailableCount']
3029
provisioned_count = volume['provisionedCount']
3130
table.add_row([datacenter_name, maximum_available_count, provisioned_count])
32-
env.fout(table)
31+
env.fout(table)

tests/CLI/modules/block_tests.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -669,11 +669,11 @@ def test_set_password(self):
669669
@mock.patch('SoftLayer.BlockStorageManager.list_block_volume_limit')
670670
def test_volume_limit(self, list_mock):
671671
list_mock.return_value = [
672-
{
673-
"datacenterName": "global",
674-
"maximumAvailableCount": 300,
675-
"provisionedCount": 100
676-
}]
672+
{
673+
"datacenterName": "global",
674+
"maximumAvailableCount": 300,
675+
"provisionedCount": 100
676+
}]
677677

678678
result = self.run_command(['block', 'volume-limit'])
679679
self.assert_no_fail(result)

tests/CLI/modules/file_tests.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -666,14 +666,13 @@ def test_modify_order(self, order_mock):
666666
self.assertEqual('Order #24602 placed successfully!\n > Storage as a Service\n > 1000 GBs\n > 4 IOPS per GB\n',
667667
result.output)
668668

669-
670669
@mock.patch('SoftLayer.FileStorageManager.list_file_volume_limit')
671670
def test_volume_limit(self, list_mock):
672671
list_mock.return_value = [
673-
{
674-
"datacenterName": "global",
675-
"maximumAvailableCount": 300,
676-
"provisionedCount": 100
677-
}]
672+
{
673+
'datacenterName': 'global',
674+
'maximumAvailableCount': 300,
675+
'provisionedCount': 100
676+
}]
678677
result = self.run_command(['file', 'volume-limit'])
679678
self.assert_no_fail(result)

tests/managers/block_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,4 +939,4 @@ def test_setCredentialPassword(self):
939939

940940
def test_list_block_volume_limit(self):
941941
result = self.block.list_block_volume_limit()
942-
self.assertEqual(fixtures.SoftLayer_Network_Storage.getVolumeCountLimits,result)
942+
self.assertEqual(fixtures.SoftLayer_Network_Storage.getVolumeCountLimits, result)

tests/managers/cdn_tests.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ def test_add_origin(self):
4949
cache_query="include all")
5050

5151
args = ({
52-
'uniqueId': "12345",
53-
'origin': '10.10.10.1',
54-
'path': '/example/videos',
52+
'uniqueId': "12345",
53+
'origin': '10.10.10.1',
54+
'path': '/example/videos',
5555
'originType': 'HOST_SERVER',
5656
'header': 'test.example.com',
5757
'httpPort': 80,
5858
'protocol': 'HTTP',
5959
'performanceConfiguration': 'General web delivery',
6060
'cacheKeyQueryRule': "include all"
61-
},)
61+
},)
6262
self.assert_called_with('SoftLayer_Network_CdnMarketplace_Configuration_Mapping_Path',
6363
'createOriginPath',
6464
args=args)
@@ -69,9 +69,9 @@ def test_add_origin_with_bucket_and_file_extension(self):
6969
protocol='http', optimize_for="web", cache_query="include all")
7070

7171
args = ({
72-
'uniqueId': "12345",
73-
'origin': '10.10.10.1',
74-
'path': '/example/videos',
72+
'uniqueId': "12345",
73+
'origin': '10.10.10.1',
74+
'path': '/example/videos',
7575
'originType': 'OBJECT_STORAGE',
7676
'header': 'test.example.com',
7777
'httpPort': 80,
@@ -80,7 +80,7 @@ def test_add_origin_with_bucket_and_file_extension(self):
8080
'fileExtension': 'jpg',
8181
'performanceConfiguration': 'General web delivery',
8282
'cacheKeyQueryRule': "include all"
83-
},)
83+
},)
8484
self.assert_called_with('SoftLayer_Network_CdnMarketplace_Configuration_Mapping_Path',
8585
'createOriginPath',
8686
args=args)

tests/managers/file_tests.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,6 @@ def test_order_file_duplicate_performance_no_duplicate_snapshot(self):
668668
def test_order_file_duplicate_performance(self):
669669
mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
670670
mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
671-
672671
mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
673672
mock_volume['storageType']['keyName'] = 'PERFORMANCE_FILE_STORAGE'
674673
mock = self.set_mock('SoftLayer_Network_Storage', 'getObject')

tests/managers/ordering_tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ def test_get_item_capacity_core(self):
722722
"capacity": "1",
723723
"id": 10201,
724724
"keyName": "GUEST_CORE_1_DEDICATED",
725-
}]
725+
}]
726726

727727
item_capacity = self.ordering.get_item_capacity(items, ['GUEST_CORE_1_DEDICATED', 'OS_RHEL_7_X_LAMP_64_BIT'])
728728

@@ -739,7 +739,7 @@ def test_get_item_capacity_storage(self):
739739
"capacity": "1",
740740
"id": 10201,
741741
"keyName": "READHEAVY_TIER",
742-
}]
742+
}]
743743

744744
item_capacity = self.ordering.get_item_capacity(items, ['READHEAVY_TIER', 'STORAGE_SPACE_FOR_2_IOPS_PER_GB'])
745745

0 commit comments

Comments
 (0)