Skip to content

Commit

Permalink
Even more work on do(). Cleanup of success flag stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaite committed Apr 28, 2010
1 parent 3dade44 commit e70bab1
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions client/pony_client.py
Expand Up @@ -793,6 +793,7 @@ def _upload_file(server_url, fileobj, auth_key):
def do(name, commands, context=None, arch=None, stop_if_failure=True):
reslist = []
initialized = True
success = True

if context is None:
context = Context()
Expand All @@ -801,9 +802,10 @@ def do(name, commands, context=None, arch=None, stop_if_failure=True):
context.initialize()
except:
log_critical('%s failed to initialize properly!' % context)
success = False
initialized = False

if initialized:
if initialized and success:
for c in commands:
log_debug('running:', str(c))
context.start_command(c)
Expand All @@ -815,18 +817,17 @@ def do(name, commands, context=None, arch=None, stop_if_failure=True):
finally:
context.end_command(c)
reslist.append(c.get_results())
if c.success():
success = True
else:
success = False
break

context.finish()

if arch is None:
arch = get_arch()

success = True
for c in commands:
if not c.success():
success = False
break

client_info = dict(package=name, arch=arch, success=success,
initialized=initialized)
files_to_upload = None
Expand Down

0 comments on commit e70bab1

Please sign in to comment.