Skip to content

Commit

Permalink
skip Encoding for config_override_name if is null or ""
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamad Ghanem authored and Mohamad Ghanem committed Dec 2, 2024
1 parent 64fc704 commit 55b56aa
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions plugins/modules/sentinelone_config_overrides.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,14 @@ def get_current_config_override(self, module: AnsibleModule):
else:
query_options.append("versionOption=SPECIFIC")
query_options.append(f"agentVersions={self.agent_version}")
# Encode the parameters
encoded_params_name_like = quote_plus(self.config_override_name)
query_options.append(f"name__like={encoded_params_name_like}")

if self.config_override_name is None or self.config_override_name == "":
query_options.append(f"name__like={self.config_override_name}")
else:
# Encode the parameters
encoded_params_name_like = quote_plus(self.config_override_name)
query_options.append(f"name__like={encoded_params_name_like}")

query_uri = '&'.join(query_options)
api_url = f"{self.api_endpoint_config_overrides}?{query_uri}"
response = self.api_call(module, api_url, error_msg=error_msg)
Expand Down

0 comments on commit 55b56aa

Please sign in to comment.