summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGhe Rivero <ghe.rivero@hp.com>2015-06-04 13:06:43 +0200
committerGhe Rivero <ghe.rivero@hp.com>2015-06-05 16:20:07 +0200
commitbc253d62b9a61575c3ba2f443b2429b5df904905 (patch)
tree067b1ffce7e6f6cffdea8603e1108b41966c5226
parentb1e562c3e59f64118d184e8655c7bfe343a09cdc (diff)
downloados-client-config-bc253d62b9a61575c3ba2f443b2429b5df904905.tar.gz
Raise a warning with conflicting SSL params
Setting a cacert to check the cloud cert is useless when changing the default verify flag to False since this will have precedence. Raise a warning to alert the user about this behavior. Change-Id: I099d03fef5e8da0d6eed572613f4693604173ecd
-rw-r--r--os_client_config/cloud_config.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/os_client_config/cloud_config.py b/os_client_config/cloud_config.py
index d8ac85d..018908e 100644
--- a/os_client_config/cloud_config.py
+++ b/os_client_config/cloud_config.py
@@ -12,6 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
+import warnings
+
class CloudConfig(object):
def __init__(self, name, region, config):
@@ -46,6 +48,11 @@ class CloudConfig(object):
verify = self.config['cacert']
else:
verify = self.config['verify']
+ if self.config['cacert']:
+ warnings.warn(
+ "You are specifying a cacert for the cloud {0} but "
+ "also to ignore the host verification. The host SSL cert "
+ "will not be verified.".format(self.name))
cert = self.config.get('cert', None)
if cert: