aboutsummaryrefslogtreecommitdiffstats
path: root/policyhandler/policy_updater.py
diff options
context:
space:
mode:
authorAlex Shatov <alexs@att.com>2018-08-10 11:03:02 -0400
committerAlex Shatov <alexs@att.com>2018-08-10 11:03:02 -0400
commit1c4c6626f2abb24bcb35af581c6e57130f0ccae2 (patch)
tree50685aa2bbb965a6a281eef50e449b48c2e3e87c /policyhandler/policy_updater.py
parentd7f34d4b71ec4d86547628cda351d20bff4d017f (diff)
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 <alexs@att.com> Issue-ID: DCAEGEN2-492
Diffstat (limited to 'policyhandler/policy_updater.py')
-rw-r--r--policyhandler/policy_updater.py10
1 files changed, 5 insertions, 5 deletions
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)