From 1c4c6626f2abb24bcb35af581c6e57130f0ccae2 Mon Sep 17 00:00:00 2001 From: Alex Shatov Date: Fri, 10 Aug 2018 11:03:02 -0400 Subject: 4.0.1 fix for removing the non-matching policy - fixed removing the policy that no longer match the filter = sending an empty policy_filter_matches for the policy_id - cleaner workaround on getting the updated policy when policy-engine sent policy-update notification before finishing the update on there side = using the collection of expected_versions instead of min_version_expected - some minor refactoring on policy_matcher and audit Change-Id: Ica3cb810378e61d6991c616f88265ff170d32a64 Signed-off-by: Alex Shatov Issue-ID: DCAEGEN2-492 --- policyhandler/policy_updater.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'policyhandler/policy_updater.py') diff --git a/policyhandler/policy_updater.py b/policyhandler/policy_updater.py index 3ae8199..7733146 100644 --- a/policyhandler/policy_updater.py +++ b/policyhandler/policy_updater.py @@ -302,20 +302,20 @@ class PolicyUpdater(Thread): else: message = PolicyUpdateMessage(updated_policies, removed_policies, policy_filter_matches, False) - log_updates = ("policies-updated[{0}], removed[{1}]" - .format(len(updated_policies), len(removed_policies))) + log_updates = ("policies-updated[{}], removed[{}], policy_filter_matches[{}]" + .format(len(updated_policies), + len(removed_policies), + len(policy_filter_matches))) audit.reset_http_status_not_found() DeployHandler.policy_update(audit, message) + log_line = "request_id[{}]: {}".format(audit.request_id, str(message)) if not audit.is_success(): result = "- failed to send to deployment-handler {}".format(log_updates) PolicyUpdater._logger.warning(result) else: result = "- sent to deployment-handler {}".format(log_updates) - log_line = "request_id: {} updated_policies: {} removed_policies: {}".format( - audit.request_id, - json.dumps(updated_policies), json.dumps(removed_policies)) audit.audit_done(result=result) PolicyUpdater._logger.info(log_line + " " + result) -- cgit 1.2.3-korg