#589 fix scratch ref for scm callback
Merged 6 years ago by mikem. Opened 6 years ago by mikem.

file modified
+2 -2
@@ -4497,13 +4497,13 @@ 

          logfile = self.workdir + '/checkout.log'

          uploadpath = self.getUploadDir()

  

-         self.run_callbacks('preSCMCheckout', scminfo=scm.get_info(), build_tag=build_tag, scratch=self.opts.get('scratch'))

+         self.run_callbacks('preSCMCheckout', scminfo=scm.get_info(), build_tag=build_tag, scratch=opts.get('scratch'))

          # Check out spec file, etc. from SCM

          sourcedir = scm.checkout(scmdir, self.session, uploadpath, logfile)

          self.run_callbacks("postSCMCheckout",

                             scminfo=scm.get_info(),

                             build_tag=build_tag,

-                            scratch=self.opts.get('scratch'),

+                            scratch=opts.get('scratch'),

                             srcdir=sourcedir)

          # chown the sourcedir and everything under it to the mockuser

          # so we can build the srpm as non-root

sort of a follow up to #587

:thumbsup:
But, are self.opts and opts the same things here?

But, are self.opts and opts the same things here?

They are not, which is why the fix is needed. The BaseTaskHandler class sets self.opts to the keyword arguments of the call. Some subclasses reassign it later, but not this one. In this case, opts == self.opts['opts'] (that is, assuming opts was passed as a keyword argument and not as the third positional argument).

Commit c9719ac fixes this pull-request

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

6 years ago