Skip to content
This repository has been archived by the owner on Feb 20, 2018. It is now read-only.

Commit

Permalink
run_script uses ws.status
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislav Zubov authored and Stanislav Zubov committed Sep 25, 2015
1 parent ba5a891 commit 686863d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions vmmaster/webdriver/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,18 +243,19 @@ def run(*args):
def on_message(ws, message):
ws.output += message
if sub_step:
msg = json.dumps({"status": 0, "output": ws.output})
msg = json.dumps({"status": ws.status, "output": ws.output})
update_log_step(sub_step, message=msg)

def on_close(ws):
if sub_step and ws.output:
msg = json.dumps({"status": 0, "output": ws.output})
msg = json.dumps({"status": ws.status, "output": ws.output})
update_log_step(sub_step, message=msg)
log.info("RunScript: Close websocket on vm %s" % host)

def on_error(ws, message):
global status_code
status_code = 500
ws.status = 1
ws.output = repr(message)
log.debug("RunScript error: %s" % message)

Expand Down
2 changes: 1 addition & 1 deletion vmpool/vmqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def run(self):
if vm:
try:
self.queue.dequeue(delayed_vm)
except ValueError:
except QueueItemNotFound:
vm.delete()
else:
delayed_vm.vm = vm
Expand Down

0 comments on commit 686863d

Please sign in to comment.