mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Fix argument parsing for arguments containing pound signs
Passing these through yaml.safe_load() will result in the pound sign and everything after it being interpreted as a comment. This commit stops the argument from being passed through yaml.safe_load if it is a string and contains a pound sign.
This commit is contained in:
parent
7442158364
commit
5ec7d9b113
@ -195,6 +195,10 @@ def yamlify_arg(arg):
|
||||
try:
|
||||
original_arg = str(arg)
|
||||
if isinstance(arg, string_types):
|
||||
if '#' in arg:
|
||||
# Don't yamlify this argument or the '#' and everything after
|
||||
# it will be interpreted as a comment.
|
||||
return arg
|
||||
if '\n' not in arg:
|
||||
arg = yaml.safe_load(arg)
|
||||
if isinstance(arg, dict):
|
||||
|
Loading…
Reference in New Issue
Block a user