From 917fc02bcdf22140f75e640dc913a698950092ea Mon Sep 17 00:00:00 2001 From: Lukas Holecek Date: Aug 28 2019 07:41:16 +0000 Subject: Fix exception when gating.yaml is not found Signed-off-by: Lukas Holecek --- diff --git a/greenwave/policies.py b/greenwave/policies.py index 4b2b31e..cdb0ddf 100644 --- a/greenwave/policies.py +++ b/greenwave/policies.py @@ -468,6 +468,9 @@ class RemoteRule(Rule): logging.exception( 'Failed to retrieve policies for %r', subject_identifier) + if sub_policies is None: + return False + return any(sub_policy.matches(**attributes) for sub_policy in sub_policies) def to_json(self):