summaryrefslogtreecommitdiff
path: root/cloudinit/net/cmdline.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@gmail.com>2016-06-06 18:42:29 -0700
committerJoshua Harlow <harlowja@gmail.com>2016-06-06 18:42:29 -0700
commitf640797e342b6efbfb838a6350b312935222e992 (patch)
tree4e893298101cf3141d80b4bf2a2d6e009462502d /cloudinit/net/cmdline.py
parent85a53d66ad0241b2d6453d902487bb2edc1512b8 (diff)
parentbc9bd58d1533d996029770da758f73217c15af33 (diff)
downloadvyos-cloud-init-f640797e342b6efbfb838a6350b312935222e992.tar.gz
vyos-cloud-init-f640797e342b6efbfb838a6350b312935222e992.zip
Rebase against master
Diffstat (limited to 'cloudinit/net/cmdline.py')
-rw-r--r--cloudinit/net/cmdline.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/cloudinit/net/cmdline.py b/cloudinit/net/cmdline.py
index 41cba893..39523be2 100644
--- a/cloudinit/net/cmdline.py
+++ b/cloudinit/net/cmdline.py
@@ -43,17 +43,13 @@ def _load_shell_content(content, add_empty=False, empty_val=None):
then add entries in to the returned dictionary for 'VAR='
variables. Set their value to empty_val."""
data = {}
- for line in _shlex_split(content):
- try:
- key, value = line.split("=", 1)
- except ValueError:
- # Unsplittable line, skip it...
- pass
- else:
- if not value:
- value = empty_val
- if add_empty or value:
- data[key] = value
+ for line in shlex.split(content):
+ key, value = line.split("=", 1)
+ if not value:
+ value = empty_val
+ if add_empty or value:
+ data[key] = value
+
return data