commit 00aea3bc08d1e7d3988b8d05fbed28d7ab08ed9e Author: Pavlo Shchelokovskyy Date: Fri Oct 9 15:00:48 2020 +0300 Expand user path when loading SSL-related files with this patch the cacert, cert and key items in the clouds.yaml can have shortened form like "~/.ssl/api.pem" Change-Id: I3bd12fe0c47a5f373bb231babd260b801a6c411a diff --git a/openstack/config/cloud_region.py b/openstack/config/cloud_region.py index 8f03d53..cf5fbaa 100644 --- a/openstack/config/cloud_region.py +++ b/openstack/config/cloud_region.py @@ -13,6 +13,7 @@ # under the License. import copy +import os.path import warnings import urllib @@ -338,7 +339,7 @@ class CloudRegion: if insecure: verify = False if verify and cacert: - verify = cacert + verify = os.path.expanduser(cacert) else: if cacert: warnings.warn( @@ -349,8 +350,9 @@ class CloudRegion: cert = self.config.get('cert') if cert: + cert = os.path.expanduser(cert) if self.config.get('key'): - cert = (cert, self.config.get('key')) + cert = (cert, os.path.expanduser(self.config.get('key'))) return (verify, cert) def get_services(self):