summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Kajinami <tkajinam@redhat.com>2022-06-24 10:02:39 +0900
committerTakashi Kajinami <tkajinam@redhat.com>2022-07-07 16:29:55 +0000
commit2f125d83293ab4bf8037770fe8f620bc3664d0c6 (patch)
tree6fcee278889271510a12140d5fee993b52a2d39a
parent316ce9659acdec0bc45f8a33825ae3b076199b24 (diff)
downloadglance-2f125d83293ab4bf8037770fe8f620bc3664d0c6.tar.gz
glance-cache-prefetcher: Set up access to multistore backends
... because the command requires access to backend stores to pull image data. Closes-Bug: #1979699 Change-Id: I04efbb7fd47b8b1e022d96c40011b6f03508db2e (cherry picked from commit 6964e627d5b98c2034aea4bebb72cdab7549b6b5) (cherry picked from commit b4091752b4a771a54b5298d15729352ae9552e81)
-rw-r--r--glance/cmd/cache_prefetcher.py12
-rw-r--r--releasenotes/notes/bug-1979699-70182ec2aead0383.yaml6
2 files changed, 15 insertions, 3 deletions
diff --git a/glance/cmd/cache_prefetcher.py b/glance/cmd/cache_prefetcher.py
index 5310f7a39..9a6c521d3 100644
--- a/glance/cmd/cache_prefetcher.py
+++ b/glance/cmd/cache_prefetcher.py
@@ -48,10 +48,16 @@ def main():
try:
config.parse_cache_args()
logging.setup(CONF, 'glance')
+ CONF.import_opt('enabled_backends', 'glance.common.wsgi')
- glance_store.register_opts(config.CONF)
- glance_store.create_stores(config.CONF)
- glance_store.verify_default_store()
+ if CONF.enabled_backends:
+ glance_store.register_store_opts(CONF)
+ glance_store.create_multi_stores(CONF)
+ glance_store.verify_store()
+ else:
+ glance_store.register_opts(CONF)
+ glance_store.create_stores(CONF)
+ glance_store.verify_default_store()
app = prefetcher.Prefetcher()
app.run()
diff --git a/releasenotes/notes/bug-1979699-70182ec2aead0383.yaml b/releasenotes/notes/bug-1979699-70182ec2aead0383.yaml
new file mode 100644
index 000000000..68db1bdd1
--- /dev/null
+++ b/releasenotes/notes/bug-1979699-70182ec2aead0383.yaml
@@ -0,0 +1,6 @@
+---
+fixes:
+ - |
+ `Bug #1979699 <https://bugs.launchpad.net/glance/+bug/1979699>`_: Fix
+ the ``glance-cache-prefetcher`` command to set up access to backend stores
+ when the multi store feature is used.