Sandro Bonazzola has uploaded a new change for review.

Change subject: upload: raising an execption on bad gzip files
......................................................................

upload: raising an execption on bad gzip files

Raising an exception to mimic past bahavior

Change-Id: I76ae1a09b52a53a09e351c97eccad300952ae539
Bug-Url: https://bugzilla.redhat.com/1156107
Signed-off-by: Simone Tiraboschi <[email protected]>
(cherry picked from commit b79bcd11a2d515dfddb4fc21ac0efc06a334b23e)
---
M src/__main__.py
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-image-uploader 
refs/changes/04/34504/1

diff --git a/src/__main__.py b/src/__main__.py
index 6ed3d8b..747ed08 100644
--- a/src/__main__.py
+++ b/src/__main__.py
@@ -723,6 +723,11 @@
             stderr=subprocess.PIPE,
         )
         outerr = exttar.communicate()
+        rc = exttar.returncode
+        if rc == 2:
+            raise Exception(
+                _("not a gzip file")
+            )
         if outerr[1] != '':
             logging.error(
                 _(


-- 
To view, visit http://gerrit.ovirt.org/34504
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I76ae1a09b52a53a09e351c97eccad300952ae539
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-image-uploader
Gerrit-Branch: ovirt-image-uploader-3.5
Gerrit-Owner: Sandro Bonazzola <[email protected]>
Gerrit-Reviewer: Simone Tiraboschi <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to