Bug 407 : Deleting Package on Descriptor Validation Failure 33/5633/1
authorAnurag Dwivedi <anurag.dwivedi@riftio.com>
Tue, 31 Oct 2017 06:46:17 +0000 (02:46 -0400)
committerAnurag Dwivedi <anurag.dwivedi@riftio.com>
Tue, 31 Oct 2017 06:46:17 +0000 (02:46 -0400)
Signed-off-by: Anurag Dwivedi <anurag.dwivedi@riftio.com>
rwlaunchpad/plugins/rwlaunchpadtasklet/rift/tasklets/rwlaunchpad/uploader.py

index 38e2ae9..800c7ef 100644 (file)
@@ -461,6 +461,7 @@ class OnboardPackage(downloader.DownloaderProtocol):
                     self.validate_descriptor_fields(temp_package)
                 except Exception as e:
                     self.log.exception("Descriptor validation Failed")
+                    self.delete_stored_package(stored_package)
                     raise
                 try:
                     self.extract_icons(temp_package)
@@ -489,6 +490,7 @@ class OnboardPackage(downloader.DownloaderProtocol):
             if str(e):
                 self.log.message(OnboardError(str(e)))
             self.log.message(OnboardFailure())
+            raise OnboardException(OnboardFailure())
 
     def on_download_succeeded(self, job):
         self.log.message(DownloadSuccess("Package downloaded."))