diff options
author | Scott Moser <smoser@ubuntu.com> | 2015-07-27 16:53:50 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2015-07-27 16:53:50 -0400 |
commit | 81a9f17a71f9cac4c78ea5ce80b4a96e3bbb9324 (patch) | |
tree | ed9b2fe43f65d2e8fc705020d7cdd4c6307b8988 /cloudinit/config/cc_ssh.py | |
parent | 22cb92421234c31b783ed9df01439c734535ba01 (diff) | |
parent | d68b340f8a6abf40f4d5cb546c91122c8856aa83 (diff) | |
download | vyos-cloud-init-81a9f17a71f9cac4c78ea5ce80b4a96e3bbb9324.tar.gz vyos-cloud-init-81a9f17a71f9cac4c78ea5ce80b4a96e3bbb9324.zip |
merge from trunk
Diffstat (limited to 'cloudinit/config/cc_ssh.py')
-rw-r--r-- | cloudinit/config/cc_ssh.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cloudinit/config/cc_ssh.py b/cloudinit/config/cc_ssh.py index c2a7af72..5bd2dec6 100644 --- a/cloudinit/config/cc_ssh.py +++ b/cloudinit/config/cc_ssh.py @@ -41,7 +41,8 @@ CONFIG_KEY_TO_FILE = {} PRIV_TO_PUB = {} for k in GENERATE_KEY_NAMES: CONFIG_KEY_TO_FILE.update({"%s_private" % k: (KEY_FILE_TPL % k, 0o600)}) - CONFIG_KEY_TO_FILE.update({"%s_public" % k: (KEY_FILE_TPL % k + ".pub", 0o600)}) + CONFIG_KEY_TO_FILE.update( + {"%s_public" % k: (KEY_FILE_TPL % k + ".pub", 0o600)}) PRIV_TO_PUB["%s_private" % k] = "%s_public" % k KEY_GEN_TPL = 'o=$(ssh-keygen -yf "%s") && echo "$o" root@localhost > "%s"' @@ -100,7 +101,8 @@ def handle(_name, cfg, cloud, log, _args): sys.stdout.write(util.decode_binary(out)) except util.ProcessExecutionError as e: err = util.decode_binary(e.stderr).lower() - if e.exit_code == 1 and err.lower().startswith("unknown key"): + if (e.exit_code == 1 and + err.lower().startswith("unknown key")): log.debug("ssh-keygen: unknown key type '%s'", keytype) else: util.logexc(log, "Failed generating key type %s to " |