#579 Fixes import fail with sources already imported
Merged 2 years ago by onosek. Opened 2 years ago by drumian.
drumian/rpkg RHELCMP-6481  into  master

file modified
+4 -1
@@ -2144,7 +2144,10 @@ 

      def import_srpm(self):

          uploadfiles = self.cmd.import_srpm(self.args.srpm)

          if uploadfiles:

-             self.cmd.upload(uploadfiles, replace=True, offline=self.args.offline)

+             try:

+                 self.cmd.upload(uploadfiles, replace=True, offline=self.args.offline)

+             except AlreadyUploadedError:

+                 self.log.info("All sources were already uploaded.")

          if not self.args.skip_diffs:

              self.cmd.diff(cached=True)

          self.log.info('--------------------------------------------')

file modified
+1 -5
@@ -1531,11 +1531,7 @@ 

  

      def test_import(self):

          self.assert_import_srpm(self.chaos_repo)

-         # Exception is not a functionality issue. There is no problem with

-         # uploading same file twice in a test however, the upload method checks

-         # if file has been already uploaded.

-         six.assertRaisesRegex(self, AlreadyUploadedError, r'File already uploaded',

-                               self.assert_import_srpm, self.cloned_repo_path)

+         self.assert_import_srpm(self.cloned_repo_path)

  

      def test_import_gating_and_rpmlintrc_exception(self):

          # Add three additional files to the repo. Former gating.yaml and package.rpmlintrc are

Fixes: #573
JIRA: RHELCMP-6481

Signed-off-by: Dominik Rumian drumian@redhat.com

I've tested it. Works for me.

Pull-Request has been merged by onosek

2 years ago
Metadata