From 5125b595a7526d60fc548c6a74519ada7b877458 Mon Sep 17 00:00:00 2001 From: gengchc2 Date: Wed, 24 Aug 2016 16:02:25 +0800 Subject: [PATCH] Using oslo_config's min attribute "min=0" is now introduced in oslo_config, so no need to check for negative integer in code for "swift_temp_url_duration". Change-Id: Iee32126ee56e2ae2e2ada97863b7b5d6bbc5cf77 --- iotronic/common/glance_service/v2/image_service.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/iotronic/common/glance_service/v2/image_service.py b/iotronic/common/glance_service/v2/image_service.py index 0656161..3326cd9 100644 --- a/iotronic/common/glance_service/v2/image_service.py +++ b/iotronic/common/glance_service/v2/image_service.py @@ -37,6 +37,7 @@ glance_opts = [ 'downloads. Required for temporary URLs.', secret=True), cfg.IntOpt('swift_temp_url_duration', + min=0, default=1200, help='The length of time in seconds that the temporary URL ' 'will be valid for. Defaults to 20 minutes. If some ' @@ -173,9 +174,6 @@ class GlanceImageService(base_image_service.BaseImageService, raise exc.MissingParameterValue(_( 'Swift temporary URLs require a Swift account string. ' 'You must provide "swift_account" as a config option.')) - if CONF.glance.swift_temp_url_duration < 0: - raise exc.InvalidParameterValue(_( - '"swift_temp_url_duration" must be a positive integer.')) seed_num_chars = CONF.glance.swift_store_multiple_containers_seed if (seed_num_chars is None or seed_num_chars < 0 or seed_num_chars > 32):