summaryrefslogtreecommitdiffstats
path: root/osdfapp.py
diff options
context:
space:
mode:
authorAnkitkumar Patel <ankit@research.att.com>2018-03-25 19:27:39 -0400
committerAnkitkumar Patel <ankit@research.att.com>2018-03-25 19:31:24 -0400
commitbc1d288ac29c3c9bf968cea5ac2d95b8bcd67eae (patch)
treee7dc43bd3bc59ab1855263c4a61832966283025c /osdfapp.py
parented70b5c6d6589e4e1ce80229612ea5b680736c4c (diff)
Update the policy adaptor and related testcases
Generalized the policy adaptor code by removing homing specific logic. Issue-ID: OPTFRA-27 Change-Id: I331030a2f3f5c0c17af1a72af9794131555a9217 Signed-off-by: Ankitkumar Patel <ankit@research.att.com>
Diffstat (limited to 'osdfapp.py')
-rwxr-xr-xosdfapp.py17
1 files changed, 2 insertions, 15 deletions
diff --git a/osdfapp.py b/osdfapp.py
index eb14530..348a88c 100755
--- a/osdfapp.py
+++ b/osdfapp.py
@@ -93,12 +93,6 @@ def handle_data_error(e):
return response
-@app.route("/api/oof/v1/healthcheck", methods=["GET"])
-def do_osdf_health_check():
- """Simple health check"""
- return "OK"
-
-
@app.route("/api/oof/v1/placement", methods=["POST"])
@auth_basic.login_required
def do_placement_opt():
@@ -110,17 +104,10 @@ def do_placement_opt():
req_id = request_json['requestInfo']['requestId']
g.request_id = req_id
audit_log.info(MH.received_request(request.url, request.remote_addr, json.dumps(request_json)))
-
PlacementAPI(request_json).validate()
-
- # Currently policies are being used only during placement, so only fetch them if placement demands is not empty
- policies, prov_status = {}, None
-
- if 'placementDemand' in request_json['placementInfo']['demandInfo']:
- policies, prov_status = get_policies(request_json, "placement")
-
+ policies = get_policies(request_json, "placement")
audit_log.info(MH.new_worker_thread(req_id, "[for placement]"))
- t = Thread(target=process_placement_opt, args=(request_json, policies, osdf_config, prov_status))
+ t = Thread(target=process_placement_opt, args=(request_json, policies, osdf_config, ""))
t.start()
audit_log.info(MH.accepted_valid_request(req_id, request))
return osdf.operation.responses.osdf_response_for_request_accept(