summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_ssh.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2015-07-22 14:10:58 -0400
committerScott Moser <smoser@ubuntu.com>2015-07-22 14:10:58 -0400
commit404baf87e58f2c9740c8b31137b727c77d182058 (patch)
tree9930213c1c10da7199a0479630cecb24dcdd25a3 /cloudinit/config/cc_ssh.py
parent70411304df996116beb0bb26ee42903e17a466cd (diff)
downloadvyos-cloud-init-404baf87e58f2c9740c8b31137b727c77d182058.tar.gz
vyos-cloud-init-404baf87e58f2c9740c8b31137b727c77d182058.zip
fixes from testing
Diffstat (limited to 'cloudinit/config/cc_ssh.py')
-rw-r--r--cloudinit/config/cc_ssh.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/cloudinit/config/cc_ssh.py b/cloudinit/config/cc_ssh.py
index cd0174da..7fb13333 100644
--- a/cloudinit/config/cc_ssh.py
+++ b/cloudinit/config/cc_ssh.py
@@ -96,12 +96,11 @@ def handle(_name, cfg, cloud, log, _args):
# TODO(harlowja): Is this guard needed?
with util.SeLinuxGuard("/etc/ssh", recursive=True):
try:
- out, err = util.subp(cmd, capture=True, rcs=[0, 1],
- env=lang_c)
- sys.stdout.write(util.encode_text(out))
+ out, err = util.subp(cmd, capture=True, env=lang_c)
+ sys.stdout.write(util.decode_binary(out))
except util.ProcessExecutionError as e:
err = util.decode_binary(e.stderr).lower()
- if err.lower().startswith("unknown key"):
+ if e.exit_code == 1 and err.lower().startswith("unknown key"):
log.debug("unknown key type %s" % keytype)
else:
util.logexc(log, "Failed generating key type %s to "