From b339f23485ca85b72f37112b08e7a9563123c2e3 Mon Sep 17 00:00:00 2001 From: George Nikolopoulos Date: Wed, 16 Aug 2017 21:14:21 +0300 Subject: [PATCH] Various small fixes (#27766) --- .../network/netscaler/netscaler_cs_action.py | 3 --- .../modules/network/netscaler/netscaler_service.py | 11 ----------- .../network/netscaler/netscaler_servicegroup.py | 14 +++++--------- .../network/netscaler/test_netscaler_lb_vserver.py | 1 + 4 files changed, 6 insertions(+), 23 deletions(-) diff --git a/lib/ansible/modules/network/netscaler/netscaler_cs_action.py b/lib/ansible/modules/network/netscaler/netscaler_cs_action.py index e597300937f..6389c54fd26 100644 --- a/lib/ansible/modules/network/netscaler/netscaler_cs_action.py +++ b/lib/ansible/modules/network/netscaler/netscaler_cs_action.py @@ -204,8 +204,6 @@ def main(): transforms = { } - json_encodes = ['targetvserverexpr'] - # Instantiate config proxy csaction_proxy = ConfigProxy( actual=csaction(), @@ -215,7 +213,6 @@ def main(): readonly_attrs=readonly_attrs, immutable_attrs=immutable_attrs, transforms=transforms, - json_encodes=json_encodes, ) try: diff --git a/lib/ansible/modules/network/netscaler/netscaler_service.py b/lib/ansible/modules/network/netscaler/netscaler_service.py index 50a17ca5834..af7edd9d41f 100644 --- a/lib/ansible/modules/network/netscaler/netscaler_service.py +++ b/lib/ansible/modules/network/netscaler/netscaler_service.py @@ -180,11 +180,6 @@ options: setting, the client-side connection port is used as the source port for the server-side connection. - "Note: This parameter is available only when the Use Source IP (USIP) parameter is set to YES." - sc: - description: - - "State of SureConnect for the service." - default: off - sp: description: - "Enable surge protection for the service." @@ -621,10 +616,6 @@ def main(): cipheader=dict(type='str'), usip=dict(type='bool'), useproxyport=dict(type='bool'), - sc=dict( - type='bool', - default=False, - ), sp=dict(type='bool'), rtspsessionidremap=dict( type='bool', @@ -742,7 +733,6 @@ def main(): 'cipheader', 'usip', 'useproxyport', - 'sc', 'sp', 'rtspsessionidremap', 'clttimeout', @@ -828,7 +818,6 @@ def main(): 'healthmonitor': ['bool_yes_no'], 'useproxyport': ['bool_yes_no'], 'rtspsessionidremap': ['bool_on_off'], - 'sc': ['bool_on_off'], 'accessdown': ['bool_yes_no'], 'cmp': ['bool_yes_no'], } diff --git a/lib/ansible/modules/network/netscaler/netscaler_servicegroup.py b/lib/ansible/modules/network/netscaler/netscaler_servicegroup.py index dc5bcb8cc4f..e39aec53d7f 100644 --- a/lib/ansible/modules/network/netscaler/netscaler_servicegroup.py +++ b/lib/ansible/modules/network/netscaler/netscaler_servicegroup.py @@ -151,11 +151,6 @@ options: the service as UP at all times. type: bool - sc: - description: - - "State of the SureConnect feature for the service group." - type: bool - sp: description: - "Enable surge protection for the service group." @@ -693,7 +688,6 @@ def main(): pathmonitorindv=dict(type='bool'), useproxyport=dict(type='bool'), healthmonitor=dict(type='bool'), - sc=dict(type='bool'), sp=dict(type='bool'), rtspsessionidremap=dict(type='bool'), clttimeout=dict(type='float'), @@ -789,7 +783,6 @@ def main(): 'pathmonitorindv', 'useproxyport', 'healthmonitor', - 'sc', 'sp', 'rtspsessionidremap', 'clttimeout', @@ -862,7 +855,6 @@ def main(): 'healthmonitor': ['bool_yes_no'], 'useproxyport': ['bool_yes_no'], 'rtspsessionidremap': ['bool_on_off'], - 'sc': ['bool_on_off'], 'graceful': ['bool_yes_no'], 'cmp': ['bool_yes_no'], } @@ -926,7 +918,11 @@ def main(): if not servicegroup_exists(client, module): module.fail_json(msg='Service group is not present', **module_result) if not servicegroup_identical(client, module, servicegroup_proxy): - module.fail_json(msg='Service group is not identical to configuration', **module_result) + module.fail_json( + msg='Service group is not identical to configuration', + diff=diff(client, module, servicegroup_proxy), + **module_result + ) if not servicemembers_identical(client, module): module.fail_json(msg='Service group members differ from configuration', **module_result) if not monitor_bindings_identical(client, module): diff --git a/test/units/modules/network/netscaler/test_netscaler_lb_vserver.py b/test/units/modules/network/netscaler/test_netscaler_lb_vserver.py index 7f3e2d25a0b..6becb5fb1f4 100644 --- a/test/units/modules/network/netscaler/test_netscaler_lb_vserver.py +++ b/test/units/modules/network/netscaler/test_netscaler_lb_vserver.py @@ -796,6 +796,7 @@ class TestNetscalerLBVServerModule(TestModule): ConfigProxy=Mock(return_value=lb_vserver_proxy_mock), ensure_feature_is_enabled=Mock(return_value=True), lb_vserver_exists=Mock(side_effect=[True, True]), + nitro_exception=self.MockException, do_state_change=do_state_change_mock, ): self.module = netscaler_lb_vserver