summaryrefslogtreecommitdiff
path: root/cloudinit/util.py
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2017-07-17 10:20:40 -0400
committerScott Moser <smoser@brickies.net>2017-07-17 10:20:40 -0400
commitbe8e84b3639d41202a4e1ce7626b2053498fecdb (patch)
tree5f7a13f3feade970d9584cd9cfdf4473230363a1 /cloudinit/util.py
parent7ed3cb3a699923623e75ad15c1c5d88abba48d00 (diff)
downloadvyos-cloud-init-be8e84b3639d41202a4e1ce7626b2053498fecdb.tar.gz
vyos-cloud-init-be8e84b3639d41202a4e1ce7626b2053498fecdb.zip
Support comments in content read by load_shell_content.
load_shell_content previously would not allow shell comment characters in the content being parsed. If comments=True is not passed then an exception would previously be raised as the line would not be guaranteed to have an '=' in it.
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r--cloudinit/util.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py
index b486e182..f570b9d3 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -2529,7 +2529,7 @@ def load_shell_content(content, add_empty=False, empty_val=None):
if PY26 and isinstance(blob, six.text_type):
# Older versions don't support unicode input
blob = blob.encode("utf8")
- return shlex.split(blob)
+ return shlex.split(blob, comments=True)
data = {}
for line in _shlex_split(content):