#631 cg_import fails immediately if build directory already exists
Merged 6 years ago by mikem. Opened 6 years ago by breilly.
breilly/koji cgimport-425  into  master

file modified
+8
@@ -5226,6 +5226,7 @@ 

  

          self.assert_policy()

          self.set_volume()

+         self.check_build_dir()

  

          koji.plugin.run_callbacks('preImport', type='cg', metadata=metadata,

                  directory=directory)
@@ -5313,6 +5314,13 @@ 

              self.buildinfo['volume_name'] = vol['name']

  

  

+     def check_build_dir(self):

+         """Check that the import directory does not already exist"""

+         path = koji.pathinfo.build(self.buildinfo)

+         if os.path.lexists(path):

+             raise koji.GenericError("Destination directory already exists: %s" % path)

+ 

+ 

      def prep_build(self):

          metadata = self.metadata

          buildinfo = get_build(metadata['build'], strict=False)

no initial comment

You are checking the wrong directory here.

The directory value that is passed into the call is the directory that the contents have been uploaded to. This is normally expected to exist.

1 new commit added

  • Changed check to correct build import dir
6 years ago

2 new commits added

  • Changed check to correct build import dir
  • cg_import fails immediately if build directory already exists
6 years ago

Commit 21fefc4 fixes this pull-request

Pull-Request has been merged by mikem@redhat.com

6 years ago