@@ -61,18 +61,11 @@ def get_resource(client, resource_name, resource_id=None, resource_module_params
6161
6262 if resource_name .endswith ("_binding" ):
6363 # binding resources require `filter` instead of `args` to uniquely identify a resource
64- if resource_name .startswith ("systemglobal_" ):
65- status_code , response_body = client .get (
66- resource = "systemglobal" ,
67- id = resource_id ,
68- filter = get_args ,
69- )
70- else :
71- status_code , response_body = client .get (
72- resource = resource_name ,
73- id = resource_id ,
74- filter = get_args ,
75- )
64+ status_code , response_body = client .get (
65+ resource = resource_name ,
66+ id = resource_id ,
67+ filter = get_args ,
68+ )
7669 elif resource_name in {"sslcertfile" }:
7770 status_code , response_body = client .get (
7871 resource = resource_name ,
@@ -99,7 +92,7 @@ def get_resource(client, resource_name, resource_id=None, resource_module_params
9992 return False , []
10093 if status_code in HTTP_SUCCESS_CODES :
10194 # for zero bindings and some resources, the response_body will be {'errorcode': 0, 'message': 'Done', 'severity': 'NONE'}
102- if resource_name not in response_body and not resource_name . startswith ( "systemglobal_" ) :
95+ if resource_name not in response_body :
10396 if resource_name == "sslcipher" :
10497 resource_primary_key = NITRO_RESOURCE_MAP [resource_name ]["primary_key" ]
10598 return True , [
@@ -108,12 +101,7 @@ def get_resource(client, resource_name, resource_id=None, resource_module_params
108101
109102 return False , []
110103 # `update-only` resources return a dict instead of a list.
111- if resource_name .startswith ("systemglobal_" ):
112- return_response = response_body .get ("systemglobal" , None )
113- if return_response is None :
114- return False , []
115- else :
116- return_response = response_body [resource_name ]
104+ return_response = response_body [resource_name ]
117105 # FIXME: NITRO-BUG: for some resources like `policypatset_pattern_binding`, NITRO returns keys with uppercase. eg: `String` for `string`.
118106 # So, we are converting the keys to lowercase.
119107 # except for `ping` and `traceroute`, all the othe resources returns a keys with lowercase.
@@ -133,19 +121,15 @@ def get_resource(client, resource_name, resource_id=None, resource_module_params
133121 )
134122
135123 # Take care of NITRO Anomolies
136- if return_response is not None :
137- return_response = fix_nitro_anomolies (
138- resource_name , resource_module_params , return_response
139- )
140- return (True , return_response if return_response is not None else [])
124+ return_response = fix_nitro_anomolies (
125+ resource_name , resource_module_params , return_response
126+ )
127+ return (True , return_response )
141128 return False , []
142129
143130
144131@trace
145132def fix_nitro_anomolies (resource_name , resource_module_params , return_response ):
146- if return_response is None :
147- return []
148-
149133 for resource in return_response :
150134 # FIXME: NITRO-BUG: in lbmonitor, for `interval=60`, the `units3` will wrongly be set to `MIN` by the NetScaler.
151135 # Hence, we will set it to `SEC` to make it idempotent
0 commit comments