@@ -63,8 +63,19 @@ def _set_acls(self, image):
63
63
member_ids = [m .member_id for m in member_repo .list ()]
64
64
for location in image .locations :
65
65
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
66
77
self .store_api .set_acls_for_multi_store (
67
- location ['url' ], location [ 'metadata' ]. get ( 'store' ) ,
78
+ location ['url' ], image_store ,
68
79
public = public , read_tenants = member_ids ,
69
80
context = self .context
70
81
)
@@ -655,8 +666,19 @@ def _set_acls(self):
655
666
member_ids = [m .member_id for m in self .repo .list ()]
656
667
for location in self .image .locations :
657
668
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
658
680
self .store_api .set_acls_for_multi_store (
659
- location ['url' ], location [ 'metadata' ]. get ( 'store' ) ,
681
+ location ['url' ], image_store ,
660
682
public = public , read_tenants = member_ids ,
661
683
context = self .context
662
684
)
0 commit comments