aboutsummaryrefslogtreecommitdiffstats
path: root/osdf/adapters/policy/interface.py
diff options
context:
space:
mode:
Diffstat (limited to 'osdf/adapters/policy/interface.py')
-rw-r--r--osdf/adapters/policy/interface.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/osdf/adapters/policy/interface.py b/osdf/adapters/policy/interface.py
index 0f20667..7c3118c 100644
--- a/osdf/adapters/policy/interface.py
+++ b/osdf/adapters/policy/interface.py
@@ -196,19 +196,19 @@ def get_policies(request_json, service_type):
def upload_policy_models():
"""Upload all the policy models reside in the folder"""
- model_path = "../../models/policy/placement/tosca"
requestId = uuid.uuid4()
config = osdf_config.deployment
+ model_path = config['pathPolicyModelUpload']
uid, passwd = config['policyPlatformUsername'], config['policyPlatformPassword']
pcuid, pcpasswd = config['policyClientUsername'], config['policyClientPassword']
headers = {"ClientAuth": base64.b64encode(bytes("{}:{}".format(pcuid, pcpasswd), "ascii"))}
headers.update({'Environment': config['policyPlatformEnv']})
headers.update({'X-ONAP-RequestID': requestId})
- url = config['policyPlatformUrlForModelUploading']
+ url = config['policyPlatformUrlModelUpload']
rc = RestClient(userid=uid, passwd=passwd, headers=headers, url=url, log_func=debug_log.debug)
for file in os.listdir(model_path):
- if not file.endswith(".yml"):
+ if not file.endswith(".yaml"):
continue
with open(file) as f:
file_converted = json.dumps(yaml.load(f))