From: Patel, Ankitkumar Date: Wed, 30 May 2018 20:56:02 +0000 (-0400) Subject: Fixed the config dir and default policy scope X-Git-Tag: 2.0.0-ONAP^0 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=c31743af590754408eda42837198b23c56474ccd;p=optf%2Fosdf.git Fixed the config dir and default policy scope Fixed the config dir and default policy scope Issue-ID: OPTFRA-247 Change-Id: Ie15aaaa7ac6357ddc9fc0dc262591e844001d927 Signed-off-by: Patel, Ankitkumar --- diff --git a/osdf/adapters/policy/interface.py b/osdf/adapters/policy/interface.py index dbbf122..95bfacc 100644 --- a/osdf/adapters/policy/interface.py +++ b/osdf/adapters/policy/interface.py @@ -57,7 +57,8 @@ def get_by_scope(rest_client, req, config_local, type_service): references = config_local.get('references', {}) pscope = config_local.get('policy_info', {}).get(type_service, {}).get('policy_scope', {}) service_name = dot_notation(req, references.get('service_name', {}).get('value', None)) - primary_scope = pscope['{}_scope'.format(service_name.lower() if service_name else "default")] + primary_scope = pscope['{}_scope'.format(service_name.lower() if pscope.get(service_name + "_scope", None) + else "default")] for sec_scope in pscope.get('secondary_scopes', []): policies, scope_fields = [], [] for field in sec_scope: diff --git a/osdfapp.sh b/osdfapp.sh index aa0aba5..0e1846a 100755 --- a/osdfapp.sh +++ b/osdfapp.sh @@ -25,7 +25,7 @@ cd $(dirname $0) LOGS=logs mkdir -p $LOGS -export OSDF_CONFIG_FILE=${1:-/opt/app/osdf_config.yaml} # this file may be passed by invoker +export OSDF_CONFIG_FILE=${1:-/opt/app/config/osdf_config.yaml} # this file may be passed by invoker [ ! -e "$OSDF_CONFIG_FILE" ] && unset OSDF_CONFIG_FILE python osdfapp.py 2>$LOGS/err.log 1>$LOGS/out.log < /dev/null # running the app