unarchive: improve failure detection and reporting

Related to #7777
pull/4420/head
Todd Owen 2014-06-15 13:09:16 +08:00
parent 3fb3e7e6dc
commit a4fe91050b
1 changed files with 3 additions and 1 deletions

View File

@ -234,7 +234,9 @@ def main():
# do the unpack
try:
results = handler.unarchive()
res_args['extract_results'] = handler.unarchive()
if res_args['extract_results']['rc'] != 0:
module.fail_json(msg="failed to unpack %s to %s" % (src, dest), **res_args)
except IOError:
module.fail_json(msg="failed to unpack %s to %s" % (src, dest))