Skip to content

Commit 84ef270

Browse files
author
Shiva Shankar Vaddepally
committed
not removing user/pass in header in check_mode
Signed-off-by: Shiva Shankar Vaddepally <shivashankar.vaddepally@cloud.com>
1 parent 68da007 commit 84ef270

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

plugins/module_utils/module_executor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def __init__(self, resource_name, supports_check_mode=True):
142142
self.module.params.get("nitro_user"),
143143
self.module.params.get("nitro_pass")
144144
])
145-
if have_pass:
145+
if have_pass and not self.module.check_mode:
146146
self.client._headers.pop("X-NITRO-USER", None)
147147
self.client._headers.pop("X-NITRO-PASS", None)
148148
self.client._headers.pop("Cookie", None)
@@ -160,13 +160,13 @@ def __init__(self, resource_name, supports_check_mode=True):
160160
self.module.params["nitro_auth_token"] = response["login"][0].get("sessionid", None)
161161
else:
162162
self.module.params["nitro_auth_token"] = response.get("sessionid", None)
163-
163+
164164
if not self.module.params["nitro_auth_token"]:
165165
self.return_failure("ERROR: Login failed. No sessionid returned from the NetScaler ADC")
166166
log("INFO: Login successful. Session ID: %s" % self.module.params["nitro_auth_token"])
167-
167+
168168
self.client._headers["Cookie"] = (
169-
"NITRO_AUTH_TOKEN=%s" % self.module.params["nitro_auth_token"]
169+
"NITRO_AUTH_TOKEN=%s" % self.module.params["nitro_auth_token"]
170170
)
171171

172172
self.ns_major_version, self.ns_minor_version = get_netscaler_version(

0 commit comments

Comments
 (0)