From 649c8ae0b2d06bfa613f957b205be02997a95f75 Mon Sep 17 00:00:00 2001 From: Anjana Rajagopal Date: Tue, 6 Nov 2018 13:57:34 -0600 Subject: [PATCH 1/5] NETWORK-8987 - added createDate and modifyDate parameters to sg rule-list --- SoftLayer/CLI/securitygroup/rule.py | 8 ++++++-- SoftLayer/managers/network.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/SoftLayer/CLI/securitygroup/rule.py b/SoftLayer/CLI/securitygroup/rule.py index 4f624308c..815262313 100644 --- a/SoftLayer/CLI/securitygroup/rule.py +++ b/SoftLayer/CLI/securitygroup/rule.py @@ -15,7 +15,9 @@ 'ethertype', 'portRangeMin', 'portRangeMax', - 'protocol'] + 'protocol', + 'createDate', + 'modifyDate'] @click.command() @@ -49,7 +51,9 @@ def rule_list(env, securitygroup_id, sortby): rule.get('ethertype') or formatting.blank(), port_min, port_max, - rule.get('protocol') or formatting.blank() + rule.get('protocol') or formatting.blank(), + rule.get('createDate') or formatting.blank(), + rule.get('modifyDate') or formatting.blank() ]) env.fout(table) diff --git a/SoftLayer/managers/network.py b/SoftLayer/managers/network.py index b568e8896..4223143ae 100644 --- a/SoftLayer/managers/network.py +++ b/SoftLayer/managers/network.py @@ -372,7 +372,7 @@ def get_securitygroup(self, group_id, **kwargs): 'description,' '''rules[id, remoteIp, remoteGroupId, direction, ethertype, portRangeMin, - portRangeMax, protocol],''' + portRangeMax, protocol, createDate, modifyDate],''' '''networkComponentBindings[ networkComponent[ id, From 6309d1d4a884f66cce7a84a9d1cbacec9e2d4eec Mon Sep 17 00:00:00 2001 From: Anjana Rajagopal Date: Thu, 8 Nov 2018 15:01:46 -0600 Subject: [PATCH 2/5] NETWORK-8987 - modifying the rule class and test class to have the createDate and modifyDate parameters --- tests/CLI/modules/securitygroup_tests.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/CLI/modules/securitygroup_tests.py b/tests/CLI/modules/securitygroup_tests.py index 65c496b63..09f834d70 100644 --- a/tests/CLI/modules/securitygroup_tests.py +++ b/tests/CLI/modules/securitygroup_tests.py @@ -118,8 +118,11 @@ def test_securitygroup_rule_list(self): 'remoteGroupId': None, 'protocol': None, 'portRangeMin': None, - 'portRangeMax': None}], - json.loads(result.output)) + 'portRangeMax': None, + 'createDate': None, + 'modifyDate': None + }], + json.loads(result.output)) def test_securitygroup_rule_add(self): result = self.run_command(['sg', 'rule-add', '100', From b332392d976c1a75a51a9ff4f86cbc269d260a32 Mon Sep 17 00:00:00 2001 From: Anjana Rajagopal Date: Thu, 8 Nov 2018 15:01:46 -0600 Subject: [PATCH 3/5] NETWORK-8987 - fixing indentations within securitygroup_test to resolve invocation error in build --- tests/CLI/modules/securitygroup_tests.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/CLI/modules/securitygroup_tests.py b/tests/CLI/modules/securitygroup_tests.py index 65c496b63..64ee89178 100644 --- a/tests/CLI/modules/securitygroup_tests.py +++ b/tests/CLI/modules/securitygroup_tests.py @@ -118,8 +118,10 @@ def test_securitygroup_rule_list(self): 'remoteGroupId': None, 'protocol': None, 'portRangeMin': None, - 'portRangeMax': None}], - json.loads(result.output)) + 'portRangeMax': None, + 'createDate': None, + 'modifyDate': None}], + json.loads(result.output)) def test_securitygroup_rule_add(self): result = self.run_command(['sg', 'rule-add', '100', From c4089390f9fac22b1506352d30901ceddcedf438 Mon Sep 17 00:00:00 2001 From: Anjana Rajagopal Date: Fri, 9 Nov 2018 10:27:00 -0600 Subject: [PATCH 4/5] NETWORK-8987 - fixing minor indentation to resolve pep8 error --- tests/CLI/modules/securitygroup_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CLI/modules/securitygroup_tests.py b/tests/CLI/modules/securitygroup_tests.py index 64ee89178..080d5e14b 100644 --- a/tests/CLI/modules/securitygroup_tests.py +++ b/tests/CLI/modules/securitygroup_tests.py @@ -121,7 +121,7 @@ def test_securitygroup_rule_list(self): 'portRangeMax': None, 'createDate': None, 'modifyDate': None}], - json.loads(result.output)) + json.loads(result.output)) def test_securitygroup_rule_add(self): result = self.run_command(['sg', 'rule-add', '100', From 2e94a7b641fbad2ea7b86b97d9add8927e7a5aec Mon Sep 17 00:00:00 2001 From: Anjana Rajagopal Date: Fri, 9 Nov 2018 10:27:00 -0600 Subject: [PATCH 5/5] NETWORK-8987 - fixing minor indentation to resolve pep8 error --- tests/CLI/modules/securitygroup_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CLI/modules/securitygroup_tests.py b/tests/CLI/modules/securitygroup_tests.py index 64ee89178..0fd692353 100644 --- a/tests/CLI/modules/securitygroup_tests.py +++ b/tests/CLI/modules/securitygroup_tests.py @@ -121,7 +121,7 @@ def test_securitygroup_rule_list(self): 'portRangeMax': None, 'createDate': None, 'modifyDate': None}], - json.loads(result.output)) + json.loads(result.output)) def test_securitygroup_rule_add(self): result = self.run_command(['sg', 'rule-add', '100',