#1400 backend: more verbose delete action
Merged 3 years ago by praiskup. Opened 3 years ago by praiskup.

@@ -243,7 +243,10 @@

                  result = ActionResult.FAILURE

                  continue

  

+             self.log.info("Deleting subdirs [%s] in %s",

+                           ", ".join(subdirs), chroot_path)

              if not call_copr_repo(chroot_path, delete=subdirs, devel=devel):

+                 self.log.error("createrepo_c failed in %s", chroot_path)

                  result = ActionResult.FAILURE

  

              for build_id in build_ids or []:

@@ -582,7 +582,8 @@

      return "{}-{}-{}.{}".format(name, version, release, arch)

  

  

- def call_copr_repo(directory, devel=False, add=None, delete=None, timeout=None):

+ def call_copr_repo(directory, devel=False, add=None, delete=None, timeout=None,

+                    logger=None):

      """

      Execute 'copr-repo' tool, and return True if the command succeeded.

      """
@@ -604,6 +605,8 @@

          cmd += ['--devel']

  

      try:

+         if logger:

+             logger.info("Running %s", " ".join(cmd))

          return not subprocess.call(cmd, timeout=timeout)

      except subprocess.TimeoutExpired:

          return False

It's better to have info about the copr-repo command we execute.

Maybe it would be better to say "createrepo_c failed for {0}".format(chroot_path) so we don't have to investigate other places to see where it failed?

I get that call_copr_repo is now logging too but it is info vs error so I think it would be safer to just print the path even here.

Just a small note but otherwise +1. More verbosity is always appreciated for deleting stuff.

rebased onto 2f9e06fc14d7cf46e81aede2147a6c8b748c9182

3 years ago

rebased onto 20b2e4b

3 years ago

Pull-Request has been merged by praiskup

3 years ago