X-Git-Url: https://gerrit.onap.org/r/gitweb?p=ccsdk%2Fdistribution.git;a=blobdiff_plain;f=ansible-server%2Fsrc%2Fmain%2Fansible-server%2FRestServer.py;fp=ansible-server%2Fsrc%2Fmain%2Fansible-server%2FRestServer.py;h=2b4da3357bf86c98d7cc7b53c142dfdac3e8a87b;hp=f24eae0aabdda7354ab3a4a798beb81918b189e5;hb=f5dc878f3041c069c747bf2d04a1e6b15aa68339;hpb=b594a9b61a49ccb3a53be0807fb090da3f606517 diff --git a/ansible-server/src/main/ansible-server/RestServer.py b/ansible-server/src/main/ansible-server/RestServer.py index f24eae0a..2b4da335 100755 --- a/ansible-server/src/main/ansible-server/RestServer.py +++ b/ansible-server/src/main/ansible-server/RestServer.py @@ -1,4 +1,4 @@ -""" +''' /*- * ============LICENSE_START======================================================= * ONAP : APPC @@ -21,7 +21,7 @@ * * ============LICENSE_END========================================================= */ -""" +''' import time, datetime, json, os, sys, subprocess import uuid @@ -559,7 +559,7 @@ def process_vnf_playbook(input_json, Id, EnvParameters, time_now): cherrypy.log("HostFile: " + HostFile) # if NodeList and InventoryNames need to build host file - if HaveInventoryNames & HaveNodeList: + if HaveInventoryNames and HaveNodeList: cherrypy.log("Build host file from NodeList") ret = buildHostsSysCall(input_json, PlaybookDir, inventory_names) if ret < 0: @@ -785,9 +785,10 @@ def handle_get_method(input_data): if TestRecord[input_data['Id']]['Output'] == {} and getresults_block: cherrypy.log("*** Request blocked " + input_data['Id']) - while TestRecord[input_data['Id']]['Output'] == {} \ - or 'StatusMessage' in TestRecord[input_data['Id']]['Result']: - time.sleep(5) + # while TestRecord[input_data['Id']]['Output'] == {} \ + # or 'StatusMessage' in TestRecord[input_data['Id']]['Result']: + while ActiveProcess[input_data['Id']].is_alive(): + time.sleep(3) cherrypy.log("*** Request released " + input_data['Id'])