From a4fe91050bcc02c72dee00e2801f2f0186b567aa Mon Sep 17 00:00:00 2001 From: Todd Owen Date: Sun, 15 Jun 2014 13:09:16 +0800 Subject: [PATCH] unarchive: improve failure detection and reporting Related to #7777 --- library/files/unarchive | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/files/unarchive b/library/files/unarchive index 29e9ddb9e48..35c939e3ae6 100644 --- a/library/files/unarchive +++ b/library/files/unarchive @@ -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))