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:
Erik Johnson 2013-12-04 17:18:46 -06:00
parent 7442158364
commit 5ec7d9b113

View File

@ -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):