summaryrefslogtreecommitdiff
path: root/cloudinit/util.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2012-04-04 21:35:32 -0400
committerScott Moser <smoser@ubuntu.com>2012-04-04 21:35:32 -0400
commit7b2fc4e014e6b7a43e6b8fc719d82c3d0b0a8bed (patch)
tree12859523160be456f76e0d0c33010bd6f0452ce8 /cloudinit/util.py
parentb39abf5bbe51d62d1ef1dd1e813720eafc1ddc85 (diff)
downloadvyos-cloud-init-7b2fc4e014e6b7a43e6b8fc719d82c3d0b0a8bed.tar.gz
vyos-cloud-init-7b2fc4e014e6b7a43e6b8fc719d82c3d0b0a8bed.zip
initial checkin of kernel commandline cloud-config url support
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r--cloudinit/util.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py
index 9133426c..47397418 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -840,3 +840,16 @@ def wait_for_url(urls, max_wait=None, timeout=None,
time.sleep(sleeptime)
return False
+
+
+def keyval_str_to_dict(kvstring):
+ ret = {}
+ for tok in kvstring.split():
+ try:
+ (key, val) = tok.split("=", 1)
+ except ValueError:
+ key = tok
+ val = True
+ ret[key] = val
+
+ return(ret)