summaryrefslogtreecommitdiff
path: root/cloudinit/util.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2012-04-05 00:49:11 -0400
committerScott Moser <smoser@ubuntu.com>2012-04-05 00:49:11 -0400
commitc2a4447527d5e8b2e2999b6f1832577203a64f2a (patch)
treeaa58108146e35f5ab5d93500c1116bcad12d6ce8 /cloudinit/util.py
parentb39abf5bbe51d62d1ef1dd1e813720eafc1ddc85 (diff)
parent6d62fe860f55faf2d7b0b6216c11305e114c5214 (diff)
downloadvyos-cloud-init-c2a4447527d5e8b2e2999b6f1832577203a64f2a.tar.gz
vyos-cloud-init-c2a4447527d5e8b2e2999b6f1832577203a64f2a.zip
Allow a url to cloud-config data to be specified on kernel config line
In order to allow an ephemeral, or otherwise pristine image to receive some configuration, cloud-init will read a url directed by the kernel command line and proceed as if its data had previously existed. For more information, see doc/kernel-cmdline.txt
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)