diff options
Diffstat (limited to 'azurelinuxagent/pa/provision')
-rw-r--r-- | azurelinuxagent/pa/provision/default.py | 7 | ||||
-rw-r--r-- | azurelinuxagent/pa/provision/ubuntu.py | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/azurelinuxagent/pa/provision/default.py b/azurelinuxagent/pa/provision/default.py index a99a006..3a3f36f 100644 --- a/azurelinuxagent/pa/provision/default.py +++ b/azurelinuxagent/pa/provision/default.py @@ -87,10 +87,9 @@ class ProvisionHandler(object): thumbprint = self.get_ssh_host_key_thumbprint(keypair_type) return thumbprint - def get_ssh_host_key_thumbprint(self, keypair_type): - cmd = "ssh-keygen -lf /etc/ssh/ssh_host_{0}_key.pub".format( - keypair_type) - ret = shellutil.run_get_output(cmd) + def get_ssh_host_key_thumbprint(self, keypair_type, chk_err=True): + cmd = "ssh-keygen -lf /etc/ssh/ssh_host_{0}_key.pub".format(keypair_type) + ret = shellutil.run_get_output(cmd, chk_err=chk_err) if ret[0] == 0: return ret[1].rstrip().split()[1].replace(':', '') else: diff --git a/azurelinuxagent/pa/provision/ubuntu.py b/azurelinuxagent/pa/provision/ubuntu.py index a71df37..66866b2 100644 --- a/azurelinuxagent/pa/provision/ubuntu.py +++ b/azurelinuxagent/pa/provision/ubuntu.py @@ -91,7 +91,7 @@ class UbuntuProvisionHandler(ProvisionHandler): if os.path.isfile(path): logger.info("ssh host key found at: {0}".format(path)) try: - thumbprint = self.get_ssh_host_key_thumbprint(keypair_type) + thumbprint = self.get_ssh_host_key_thumbprint(keypair_type, chk_err=False) logger.info("Thumbprint obtained from : {0}".format(path)) return thumbprint except ProvisionError: |