diff options
author | Scott Moser <smoser@ubuntu.com> | 2015-07-22 14:10:58 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2015-07-22 14:10:58 -0400 |
commit | 404baf87e58f2c9740c8b31137b727c77d182058 (patch) | |
tree | 9930213c1c10da7199a0479630cecb24dcdd25a3 | |
parent | 70411304df996116beb0bb26ee42903e17a466cd (diff) | |
download | vyos-cloud-init-404baf87e58f2c9740c8b31137b727c77d182058.tar.gz vyos-cloud-init-404baf87e58f2c9740c8b31137b727c77d182058.zip |
fixes from testing
-rw-r--r-- | cloudinit/config/cc_ssh.py | 7 |
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 " |