diff options
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r-- | cloudinit/util.py | 13 |
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) |