aboutsummaryrefslogtreecommitdiffstats
path: root/policyhandler/pdp_api_v0/policy_matcher.py
diff options
context:
space:
mode:
Diffstat (limited to 'policyhandler/pdp_api_v0/policy_matcher.py')
-rw-r--r--policyhandler/pdp_api_v0/policy_matcher.py22
1 files changed, 2 insertions, 20 deletions
diff --git a/policyhandler/pdp_api_v0/policy_matcher.py b/policyhandler/pdp_api_v0/policy_matcher.py
index 357af49..deb6619 100644
--- a/policyhandler/pdp_api_v0/policy_matcher.py
+++ b/policyhandler/pdp_api_v0/policy_matcher.py
@@ -1,5 +1,5 @@
# ================================================================================
-# Copyright (c) 2018-2019 AT&T Intellectual Property. All rights reserved.
+# Copyright (c) 2018-2020 AT&T Intellectual Property. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -38,24 +38,6 @@ class PolicyMatcher(object):
PDP_API_FOLDER = os.path.basename(os.path.dirname(os.path.realpath(__file__)))
@staticmethod
- def get_deployed_policies(audit):
- """get the deployed policies and policy-filters"""
- deployed_policies, deployed_policy_filters = DeployHandler.get_deployed_policies(audit)
-
- if audit.is_not_found():
- warning_txt = "got no deployed policies or policy-filters"
- _LOGGER.warning(warning_txt)
- return {"warning": warning_txt}, None, None
-
- if not audit.is_success() or (not deployed_policies and not deployed_policy_filters):
- error_txt = "failed to retrieve policies from deployment-handler"
- _LOGGER.error(error_txt)
- return {"error": error_txt}, None, None
-
- return None, deployed_policies, deployed_policy_filters
-
-
- @staticmethod
def build_catch_up_message(audit, deployed_policies, deployed_policy_filters):
"""
find the latest policies from policy-engine for the deployed policies and policy-filters
@@ -135,7 +117,7 @@ class PolicyMatcher(object):
@staticmethod
def match_to_deployed_policies(audit, policies_updated, policies_removed):
"""match the policies_updated, policies_removed versus deployed policies"""
- deployed_policies, deployed_policy_filters = DeployHandler.get_deployed_policies(audit)
+ _, deployed_policies, deployed_policy_filters = DeployHandler.get_deployed_policies(audit)
if not audit.is_success():
return {}, {}, {}