diff options
author | Vikas Varma <vv8305@att.com> | 2019-04-22 12:51:59 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-22 12:51:59 +0000 |
commit | 153223d6c985aba266df11243a0c112cb33377e8 (patch) | |
tree | c33cab3751fc8af2298349ac7801ea0f7cae6a5d /osdf/adapters | |
parent | 9eadcba0fa858a031f6269fc127c9dc738bb7d8b (diff) | |
parent | 3a0866a29f8eb8910e950e699ce71ffacfcf06f7 (diff) |
Merge "Insert tosca models for policy model uploading"
Diffstat (limited to 'osdf/adapters')
-rw-r--r-- | osdf/adapters/policy/interface.py | 6 |
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)) |