Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated for handling context init failure and command exceptions, asw…

…ell as fix for indentation issue
  • Loading branch information...
commit 150e3e1acab9cc78d13e85d181e3c705520b16a4 1 parent 3b3e53d
@mlaite mlaite authored
Showing with 21 additions and 13 deletions.
  1. +21 −13 client/pony_client.py
View
34 client/pony_client.py
@@ -792,22 +792,30 @@ def _upload_file(server_url, fileobj, auth_key):
def do(name, commands, context=None, arch=None, stop_if_failure=True):
reslist = []
+ init_status = True
if context:
- context.initialize()
-
- for c in commands:
- log_debug('running:', str(c))
- if context:
- context.start_command(c)
- c.run(context)
- if context:
- context.end_command(c)
-
- reslist.append(c.get_results())
+ try:
+ context.initialize()
+ except:
+ init_status = False
+
+ if init_status:
+ for c in commands:
+ log_debug('running:', str(c))
+ if context:
+ context.start_command(c)
+ try:
+ c.run(context)
+ except:
+ break
+ if context:
+ context.end_command(c)
+
+ reslist.append(c.get_results())
- if stop_if_failure and not c.success():
- break
+ if stop_if_failure and not c.success():
+ break
if context:
context.finish()
Please sign in to comment.
Something went wrong with that request. Please try again.