From 5e8ef9e879c66030d9eafe250748781015efd52c Mon Sep 17 00:00:00 2001 From: "zhangchunlong1@huawei.com" Date: Tue, 23 Sep 2014 15:50:27 +0800 Subject: [PATCH] check the configuration item glance_num_retries we need to to check the value of the configuration item glance_num_retries in the code in order to ensure the " glance_num_retries " is equal or greater than 0 Change-Id: I661ee883f3e1009e7fb242e0df2fa130eb8daa66 Closes-Bug: #1372452 --- cinder/image/glance.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cinder/image/glance.py b/cinder/image/glance.py index 16340d508..19876ed19 100644 --- a/cinder/image/glance.py +++ b/cinder/image/glance.py @@ -128,6 +128,13 @@ class GlanceClientWrapper(object): self.api_servers = None self.version = version + if CONF.glance_num_retries < 0: + LOG.warning(_( + "glance_num_retries shouldn't be a negative value. " + "The number of retries will be set to 0 until this is" + "corrected in the cinder.conf.")) + CONF.set_override('glance_num_retries', 0) + def _create_static_client(self, context, netloc, use_ssl, version): """Create a client that we'll use for every call.""" self.netloc = netloc -- 2.45.2