Commit
3e0328b992d8a90213a56ec5a4144677279bea66 broke external
decomposed plugins due to the fact that it assumes that the
context is set.
This patch validates that the context is set.
Co-Authored-By: Kevin Benton <blak111@gmail.com>
Change-Id: I3320f27be7b0fed1d3b37a5c5459d91b2bc4f13b
Closes-bug: #
1475837
# The shared attribute for a network now reflects if the network
# is shared to the calling tenant via an RBAC entry.
shared = False
+ matches = ('*',) + ((context.tenant_id,) if context else ())
for entry in network.rbac_entries:
if (entry.action == 'access_as_shared' and
- entry.target_tenant in ('*', context.tenant_id)):
+ entry.target_tenant in matches):
shared = True
break
res['shared'] = shared