diff options
author | Scott Moser <smoser@ubuntu.com> | 2015-03-02 18:48:52 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2015-03-02 18:48:52 -0500 |
commit | b11401a01151c7f53770b8b20efd3abebb42e68a (patch) | |
tree | eb15f21f1861200ea628a03b17f5466ad5d83fc7 /cloudinit/util.py | |
parent | b2af44fb22719dc353bd867c2648e0dd5b2eec19 (diff) | |
parent | 72958f9c40f53c634d1eb7ef55547271e1972d2c (diff) | |
download | vyos-cloud-init-b11401a01151c7f53770b8b20efd3abebb42e68a.tar.gz vyos-cloud-init-b11401a01151c7f53770b8b20efd3abebb42e68a.zip |
MAAS: fix oauth imports and reading of command line seed.
LP: #1427263
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r-- | cloudinit/util.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py index 039aa3f2..cc20305c 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -970,7 +970,7 @@ def get_fqdn_from_hosts(hostname, filename="/etc/hosts"): def get_cmdline_url(names=('cloud-config-url', 'url'), - starts="#cloud-config", cmdline=None): + starts=b"#cloud-config", cmdline=None): if cmdline is None: cmdline = get_cmdline() @@ -986,6 +986,8 @@ def get_cmdline_url(names=('cloud-config-url', 'url'), return (None, None, None) resp = read_file_or_url(url) + # allow callers to pass starts as text when comparing to bytes contents + starts = encode_text(starts) if resp.ok() and resp.contents.startswith(starts): return (key, url, resp.contents) |