aboutsummaryrefslogtreecommitdiffstats
path: root/osdf/adapters/policy/interface.py
diff options
context:
space:
mode:
authorShankaranarayanan Puzhavakath Narayanan <snarayanan@research.att.com>2019-04-20 17:03:04 +0000
committerGerrit Code Review <gerrit@onap.org>2019-04-20 17:03:04 +0000
commit9eadcba0fa858a031f6269fc127c9dc738bb7d8b (patch)
tree88b0226afa174c77c59cbfda35ca092774518f6e /osdf/adapters/policy/interface.py
parente1f6d80752920a7ef990134f02abb3db9b5a6232 (diff)
parentfc3ead31e631f69fabf0baaa20c10bf955ce374b (diff)
Merge "Traffic Distributtion support added"
Diffstat (limited to 'osdf/adapters/policy/interface.py')
-rw-r--r--osdf/adapters/policy/interface.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/osdf/adapters/policy/interface.py b/osdf/adapters/policy/interface.py
index 7de5858..0f20667 100644
--- a/osdf/adapters/policy/interface.py
+++ b/osdf/adapters/policy/interface.py
@@ -160,10 +160,12 @@ def local_policies_location(req_json, osdf_config, service_type):
if lp.get('global_disabled'):
return None # short-circuit to disable all local policies
if lp.get('local_{}_policies_enabled'.format(service_type)):
+ debug_log.debug('Loading local policies for service type: {}'.format(service_type))
if service_type == "scheduling":
return lp.get('{}_policy_dir'.format(service_type)), lp.get('{}_policy_files'.format(service_type))
else:
service_name = req_json['serviceInfo']['serviceName'] # TODO: data_mapping.get_service_type(model_name)
+ debug_log.debug('Loading local policies for service name: {}'.format(service_name))
return lp.get('{}_policy_dir_{}'.format(service_type, service_name.lower())), \
lp.get('{}_policy_files_{}'.format(service_type, service_name.lower()))
return None
@@ -181,6 +183,8 @@ def get_policies(request_json, service_type):
local_info = local_policies_location(request_json, osdf_config, service_type)
if local_info: # tuple containing location and list of files
+ if local_info[0] is None or local_info[1] is None:
+ raise ValueError("Error fetching local policy info")
to_filter = None
if osdf_config.core['policy_info'][service_type]['policy_fetch'] == "by_name":
to_filter = request_json[service_type + "Info"]['policyId']