From d7f793d7cb724f3c4ae4fddd795bf0f319dd2661 Mon Sep 17 00:00:00 2001 From: hussainchachuliya Date: Wed, 17 Aug 2016 14:51:55 +0530 Subject: [PATCH] Use min attribute from oslo_config "min=0" is now introduced in oslo_config, so no need to check for negative integer in code for "glance_num_retries". TrivialFix Change-Id: Ib62ad460f8ec8de1cada6ff70d026f72487691af --- cinder/common/config.py | 1 + cinder/image/glance.py | 9 +-------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/cinder/common/config.py b/cinder/common/config.py index a1a3add1f..0d92d860a 100644 --- a/cinder/common/config.py +++ b/cinder/common/config.py @@ -61,6 +61,7 @@ global_opts = [ default=1, help='Version of the glance API to use'), cfg.IntOpt('glance_num_retries', + min=0, default=0, help='Number retries when downloading an image from glance'), cfg.BoolOpt('glance_api_insecure', diff --git a/cinder/image/glance.py b/cinder/image/glance.py index 1041a45c3..8acb81d44 100644 --- a/cinder/image/glance.py +++ b/cinder/image/glance.py @@ -36,7 +36,7 @@ from six.moves import range from six.moves import urllib from cinder import exception -from cinder.i18n import _, _LE, _LW +from cinder.i18n import _, _LE glance_opts = [ @@ -157,13 +157,6 @@ class GlanceClientWrapper(object): self.api_servers = None self.version = version - if CONF.glance_num_retries < 0: - LOG.warning(_LW( - "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