diff options
Diffstat (limited to 'azurelinuxagent/pa')
-rw-r--r-- | azurelinuxagent/pa/provision/default.py | 7 | ||||
-rw-r--r-- | azurelinuxagent/pa/provision/ubuntu.py | 2 | ||||
-rw-r--r-- | azurelinuxagent/pa/rdma/centos.py | 7 |
3 files changed, 7 insertions, 9 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: diff --git a/azurelinuxagent/pa/rdma/centos.py b/azurelinuxagent/pa/rdma/centos.py index 214f9ea..10b7c81 100644 --- a/azurelinuxagent/pa/rdma/centos.py +++ b/azurelinuxagent/pa/rdma/centos.py @@ -82,8 +82,7 @@ class CentOSRDMAHandler(RDMAHandler): # Example match (pkg name, -, followed by 3 segments, fw_version and -): # - pkg=microsoft-hyper-v-rdma-4.1.0.142-20160323.x86_64 # - fw_version=142 - pattern = '{0}-\d\.\d\.\d\.({1})-'.format( - self.rdma_user_mode_package_name, fw_version) + pattern = '{0}-(\d+\.){{3,}}({1})-'.format(self.rdma_user_mode_package_name, fw_version) return re.match(pattern, pkg) @staticmethod @@ -156,7 +155,7 @@ class CentOSRDMAHandler(RDMAHandler): # Install kernel mode driver (kmod-microsoft-hyper-v-rdma-*) kmod_pkg = self.get_file_by_pattern( - pkgs, "%s-\d\.\d\.\d\.+(%s)-\d{8}\.x86_64.rpm" % (self.rdma_kernel_mode_package_name, fw_version)) + pkgs, "%s-(\d+\.){3,}(%s)-\d{8}\.x86_64.rpm" % (self.rdma_kernel_mode_package_name, fw_version)) if not kmod_pkg: raise Exception("RDMA kernel mode package not found") kmod_pkg_path = os.path.join(pkg_dir, kmod_pkg) @@ -165,7 +164,7 @@ class CentOSRDMAHandler(RDMAHandler): # Install user mode driver (microsoft-hyper-v-rdma-*) umod_pkg = self.get_file_by_pattern( - pkgs, "%s-\d\.\d\.\d\.+(%s)-\d{8}\.x86_64.rpm" % (self.rdma_user_mode_package_name, fw_version)) + pkgs, "%s-(\d+\.){3,}(%s)-\d{8}\.x86_64.rpm" % (self.rdma_user_mode_package_name, fw_version)) if not umod_pkg: raise Exception("RDMA user mode package not found") umod_pkg_path = os.path.join(pkg_dir, umod_pkg) |