summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhishek Kekane <akekane@redhat.com>2019-05-24 06:21:08 +0000
committerAbhishek Kekane <akekane@redhat.com>2019-05-29 06:23:03 +0000
commitd0d883e16dff136442ec83710288b1a2e7c57abd (patch)
tree4758e24077b973bf529d1ce4e0d4955f8f172645
parent4a037ee00c8678ce9d32be28381811f45fab7aa5 (diff)
downloadglance_store-d0d883e16dff136442ec83710288b1a2e7c57abd.tar.gz
Removed 'store_capabilities_update_min_interval' config option
Removed 'store_capabilities_update_min_interval' configuration option which was scheduled to remove during Stein development cycle. Change-Id: I1a6cfa45b5a37eacb4ba158b62fe619e1b1c9dff
-rw-r--r--glance_store/backend.py50
-rw-r--r--glance_store/capabilities.py49
-rw-r--r--glance_store/multi_backend.py50
-rw-r--r--glance_store/tests/unit/test_opts.py1
4 files changed, 0 insertions, 150 deletions
diff --git a/glance_store/backend.py b/glance_store/backend.py
index 91e5968..f40f205 100644
--- a/glance_store/backend.py
+++ b/glance_store/backend.py
@@ -109,56 +109,6 @@ Related Options:
* stores
"""),
- cfg.IntOpt('store_capabilities_update_min_interval',
- default=0,
- min=0,
- deprecated_for_removal=True,
- deprecated_since='Rocky',
- deprecated_reason="""
-This option configures a stub method that has not been implemented
-for any existing store drivers. Hence it is non-operational, and
-giving it a value does absolutely nothing.
-
-This option is scheduled for removal early in the Stein development
-cycle.
-""",
- help="""
-Minimum interval in seconds to execute updating dynamic storage
-capabilities based on current backend status.
-
-Provide an integer value representing time in seconds to set the
-minimum interval before an update of dynamic storage capabilities
-for a storage backend can be attempted. Setting
-``store_capabilities_update_min_interval`` does not mean updates
-occur periodically based on the set interval. Rather, the update
-is performed at the elapse of this interval set, if an operation
-of the store is triggered.
-
-By default, this option is set to zero and is disabled. Provide an
-integer value greater than zero to enable this option.
-
-NOTE 1: For more information on store capabilities and their updates,
-please visit: https://specs.openstack.org/openstack/glance-specs/\
-specs/kilo/store-capabilities.html
-
-For more information on setting up a particular store in your
-deployment and help with the usage of this feature, please contact
-the storage driver maintainers listed here:
-https://docs.openstack.org/glance_store/latest/user/drivers.html
-
-NOTE 2: The dynamic store update capability described above is not
-implemented by any current store drivers. Thus, this option DOES
-NOT DO ANYTHING (and it never has). It is DEPRECATED and scheduled
-for removal early in the Stein development cycle.
-
-Possible values:
- * Zero
- * Positive integer
-
-Related Options:
- * None
-
-"""),
]
_STORE_CFG_GROUP = 'glance_store'
diff --git a/glance_store/capabilities.py b/glance_store/capabilities.py
index d6963da..6a45d7d 100644
--- a/glance_store/capabilities.py
+++ b/glance_store/capabilities.py
@@ -17,10 +17,8 @@
import logging
import threading
-import time
import enum
-from eventlet import tpool
from oslo_utils import reflection
from glance_store import exceptions
@@ -141,56 +139,9 @@ class StoreCapability(object):
self._capabilities &= ~caps
-def _schedule_capabilities_update(store):
- def _update_capabilities(store, context):
- with context['lock']:
- if context['updating']:
- return
- context['updating'] = True
- try:
- store.update_capabilities()
- except Exception:
- pass
- finally:
- context['updating'] = False
- # NOTE(zhiyan): Update 'latest_update' field
- # in anyway even an exception raised, to
- # prevent call problematic routine cyclically.
- context['latest_update'] = int(time.time())
-
- global _STORE_CAPABILITES_UPDATE_SCHEDULING_BOOK
- book = _STORE_CAPABILITES_UPDATE_SCHEDULING_BOOK
- if store not in book:
- with _STORE_CAPABILITES_UPDATE_SCHEDULING_LOCK:
- if store not in book:
- book[store] = {'latest_update': int(time.time()),
- 'lock': threading.Lock(),
- 'updating': False}
- else:
- context = book[store]
- # NOTE(zhiyan): We don't need to lock 'latest_update'
- # field for check since time increased one-way only.
- sec = (int(time.time()) - context['latest_update'] -
- store.conf.glance_store.store_capabilities_update_min_interval)
- if sec >= 0:
- if not context['updating']:
- # NOTE(zhiyan): Using a real thread pool instead
- # of green pool due to store capabilities updating
- # probably calls some inevitably blocking code for
- # IO operation on remote or local storage.
- # Eventlet allows operator to uses environment var
- # EVENTLET_THREADPOOL_SIZE to desired pool size.
- tpool.execute(_update_capabilities, store, context)
-
-
def check(store_op_fun):
def op_checker(store, *args, **kwargs):
- # NOTE(zhiyan): Trigger the hook of updating store
- # dynamic capabilities based on current store status.
- if store.conf.glance_store.store_capabilities_update_min_interval > 0:
- _schedule_capabilities_update(store)
-
get_capabilities = [
BitMasks.READ_ACCESS,
BitMasks.READ_OFFSET if kwargs.get('offset') else BitMasks.NONE,
diff --git a/glance_store/multi_backend.py b/glance_store/multi_backend.py
index 74505df..8c78f85 100644
--- a/glance_store/multi_backend.py
+++ b/glance_store/multi_backend.py
@@ -43,56 +43,6 @@ Related Options:
* enabled_backends
""")),
- cfg.IntOpt('store_capabilities_update_min_interval',
- default=0,
- min=0,
- deprecated_for_removal=True,
- deprecated_since='Rocky',
- deprecated_reason=_("""
-This option configures a stub method that has not been implemented
-for any existing store drivers. Hence it is non-operational, and
-giving it a value does absolutely nothing.
-
-This option is scheduled for removal early in the Stein development
-cycle.
-"""),
- help=_("""
-Minimum interval in seconds to execute updating dynamic storage
-capabilities based on current backend status.
-
-Provide an integer value representing time in seconds to set the
-minimum interval before an update of dynamic storage capabilities
-for a storage backend can be attempted. Setting
-``store_capabilities_update_min_interval`` does not mean updates
-occur periodically based on the set interval. Rather, the update
-is performed at the elapse of this interval set, if an operation
-of the store is triggered.
-
-By default, this option is set to zero and is disabled. Provide an
-integer value greater than zero to enable this option.
-
-NOTE 1: For more information on store capabilities and their updates,
-please visit: https://specs.openstack.org/openstack/glance-specs/\
-specs/kilo/store-capabilities.html
-
-For more information on setting up a particular store in your
-deployment and help with the usage of this feature, please contact
-the storage driver maintainers listed here:
-https://docs.openstack.org/glance_store/latest/user/drivers.html
-
-NOTE 2: The dynamic store update capability described above is not
-implemented by any current store drivers. Thus, this option DOES
-NOT DO ANYTHING (and it never has). It is DEPRECATED and scheduled
-for removal early in the Stein development cycle.
-
-Possible values:
- * Zero
- * Positive integer
-
-Related Options:
- * None
-
-""")),
]
_STORE_CFG_GROUP = 'glance_store'
diff --git a/glance_store/tests/unit/test_opts.py b/glance_store/tests/unit/test_opts.py
index e2598d2..9536f39 100644
--- a/glance_store/tests/unit/test_opts.py
+++ b/glance_store/tests/unit/test_opts.py
@@ -70,7 +70,6 @@ class OptsTestCase(base.StoreBaseTest):
expected_opt_names = [
'default_store',
'stores',
- 'store_capabilities_update_min_interval',
'cinder_api_insecure',
'cinder_ca_certificates_file',
'cinder_catalog_info',