Skip to content

Commit

Permalink
changing logic to handle value
Browse files Browse the repository at this point in the history
  • Loading branch information
AAYUSH2091 committed Oct 28, 2024
1 parent 3081ccf commit 39d306d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions plugins/module_utils/network/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,12 +684,15 @@ def __call__(self, value, variables=None, fail_on_undefined=True):
if not fail_on_undefined:
return None
raise

if value is not None:
return str(value) # Ensuring we returning it as a string
# Special handling for values starting with +
if isinstance(value, str) and value.startswith('+'):
return value # Keep the + prefix intact
return str(value) # Convert everything else to string
else:
return None

def contains_vars(self, data):
if isinstance(data, string_types):
for marker in (
Expand Down

0 comments on commit 39d306d

Please sign in to comment.