diff options
author | Scott Moser <smoser@brickies.net> | 2017-03-03 02:26:38 -0500 |
---|---|---|
committer | Scott Moser <smoser@brickies.net> | 2017-03-03 02:26:38 -0500 |
commit | d7004bcf269fe60e456de336ecda9a9d2fe50bfd (patch) | |
tree | cf49b1fbc06388d46fa435814d24d97c83476047 /cloudinit/util.py | |
parent | 1de8720effd029727bb5ef7972e7e4d859a1b53a (diff) | |
parent | c81ea53bbdc4ada9d2b52430e106aeb3c38b4e0a (diff) | |
download | vyos-cloud-init-d7004bcf269fe60e456de336ecda9a9d2fe50bfd.tar.gz vyos-cloud-init-d7004bcf269fe60e456de336ecda9a9d2fe50bfd.zip |
merge from master at 0.7.9-47-gc81ea53
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r-- | cloudinit/util.py | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py index 5725129e..7196a7ca 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -1089,31 +1089,6 @@ def get_fqdn_from_hosts(hostname, filename="/etc/hosts"): return fqdn -def get_cmdline_url(names=('cloud-config-url', 'url'), - starts=b"#cloud-config", cmdline=None): - if cmdline is None: - cmdline = get_cmdline() - - data = keyval_str_to_dict(cmdline) - url = None - key = None - for key in names: - if key in data: - url = data[key] - break - - if not 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) - - return (key, url, None) - - def is_resolvable(name): """determine if a url is resolvable, return a boolean This also attempts to be resilent against dns redirection. @@ -1475,25 +1450,6 @@ def ensure_dirs(dirlist, mode=0o755): ensure_dir(d, mode) -def read_write_cmdline_url(target_fn): - if not os.path.exists(target_fn): - try: - (key, url, content) = get_cmdline_url() - except Exception: - logexc(LOG, "Failed fetching command line url") - return - try: - if key and content: - write_file(target_fn, content, mode=0o600) - LOG.debug(("Wrote to %s with contents of command line" - " url %s (len=%s)"), target_fn, url, len(content)) - elif key and not content: - LOG.debug(("Command line key %s with url" - " %s had no contents"), key, url) - except Exception: - logexc(LOG, "Failed writing url content to %s", target_fn) - - def yaml_dumps(obj, explicit_start=True, explicit_end=True): return yaml.safe_dump(obj, line_break="\n", |