]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
check the configuration item glance_num_retries
authorzhangchunlong1@huawei.com <zhangchunlong1@huawei.com>
Tue, 23 Sep 2014 07:50:27 +0000 (15:50 +0800)
committerzhangchunlong1@huawei.com <zhangchunlong1@huawei.com>
Tue, 14 Oct 2014 08:28:56 +0000 (16:28 +0800)
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

index 16340d5084a4c643ed51e7c904e1ec16da2f0441..19876ed197d4c817c8b1b77542bdf2414d2a6c71 100644 (file)
@@ -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