V and D: make security group logging more robust
Prevent exceptions Change-Id: I1a318347f92d6d793768dd20d653c872a3f75da3 (cherry picked from commit8960282459
) (cherry picked from commitc9e0278f8a
)
This commit is contained in:
parent
c1628f674c
commit
152b21f526
|
@ -526,7 +526,7 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
|
|||
# If the section/sg is already logged, then no action is
|
||||
# required.
|
||||
for sg in [sg for sg in self.get_security_groups(context)
|
||||
if sg[sg_logging.LOGGING] is False]:
|
||||
if sg.get(sg_logging.LOGGING) is False]:
|
||||
if sg.get(sg_policy.POLICY):
|
||||
# Logging is not relevant with a policy
|
||||
continue
|
||||
|
|
|
@ -495,7 +495,7 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
|
|||
fields=['id',
|
||||
sg_logging.LOGGING])
|
||||
for sg in [sg for sg in secgroups
|
||||
if sg[sg_logging.LOGGING] is False]:
|
||||
if sg.get(sg_logging.LOGGING) is False]:
|
||||
nsgroup_id, section_id = nsx_db.get_sg_mappings(
|
||||
context.session, sg['id'])
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue