Skip to content

Commit

Permalink
fix bug when run sls
Browse files Browse the repository at this point in the history
  • Loading branch information
honglei5181 committed May 26, 2016
1 parent 993f9b0 commit 9a65d3d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions states_config/views.py
Expand Up @@ -148,17 +148,16 @@ def del_sls(request):
def highstate_result(request):
sapi = SaltAPI()
if request.POST:
sls_name = request.POST.get("sls_name")
host_list = request.POST.getlist("hosts_name")
execute = request.POST.get("execute")
if execute:
host_str = ",".join(host_list)
jid = sapi.target_deploy(host_str, sls_name)
jid = sapi.target_deploy(host_str, execute)
while 1:
jids = "salt-run jobs.lookup_jid " + jid
result = os.popen(jids).read()
if len(result) > 0:
exit
break
if result == "":
result = "Execute time too long, Please see jid:" + jid + " history."
return render(request, 'states_config/highstate_result.html', {'result': result})
Expand Down

0 comments on commit 9a65d3d

Please sign in to comment.