Skip to content

Commit d90f70b

Browse files
authored
Merge pull request #41 from stackhpc/upstream/2023.1-2024-08-05
Synchronise 2023.1 with upstream
2 parents e177c71 + 6fbe498 commit d90f70b

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

glance/location.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,19 @@ def _set_acls(self, image):
6363
member_ids = [m.member_id for m in member_repo.list()]
6464
for location in image.locations:
6565
if CONF.enabled_backends:
66+
# NOTE(whoami-rajat): Do not set_acls if store is not defined
67+
# on this node. This is possible in case of edge deployment
68+
# that image location is present but the actual store is
69+
# not related to this node.
70+
image_store = location['metadata'].get('store')
71+
if image_store not in CONF.enabled_backends:
72+
msg = (_("Store %s is not available on "
73+
"this node, skipping `_set_acls` "
74+
"call.") % image_store)
75+
LOG.debug(msg)
76+
continue
6677
self.store_api.set_acls_for_multi_store(
67-
location['url'], location['metadata'].get('store'),
78+
location['url'], image_store,
6879
public=public, read_tenants=member_ids,
6980
context=self.context
7081
)
@@ -655,8 +666,19 @@ def _set_acls(self):
655666
member_ids = [m.member_id for m in self.repo.list()]
656667
for location in self.image.locations:
657668
if CONF.enabled_backends:
669+
# NOTE(whoami-rajat): Do not set_acls if store is not
670+
# defined on this node. This is possible in case of edge
671+
# deployment that image location is present but the actual
672+
# store is not related to this node.
673+
image_store = location['metadata'].get('store')
674+
if image_store not in CONF.enabled_backends:
675+
msg = (_("Store %s is not available on "
676+
"this node, skipping `_set_acls` "
677+
"call.") % image_store)
678+
LOG.debug(msg)
679+
continue
658680
self.store_api.set_acls_for_multi_store(
659-
location['url'], location['metadata'].get('store'),
681+
location['url'], image_store,
660682
public=public, read_tenants=member_ids,
661683
context=self.context
662684
)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
fixes:
3+
- |
4+
`Bug #2073945 <https://bugs.launchpad.net/glance/+bug/2073945>`_:
5+
Fixed issue with VM creation in DCN cases with RBD backend where
6+
an edge node doesn't have the store defined which is part of the
7+
image locations and the operation fails.

0 commit comments

Comments
 (0)