code: def _run_and_log(cmd, ostree_repo_path, error_msg, wd=None):
          
          logger.debug("running command %s", cmd)
          kwargs = {
              "stderr": subprocess.STDOUT,
              "env": os.environ.copy(),
          }
          if ostree_repo_path:
              # must not exist, ostree will create it
              kwargs["env"]["ATOMIC_OSTREE_REPO"] = ostree_repo_path
          if wd:
              kwargs["cwd"] = wd
          try:
              out = subprocess.check_output(cmd, **kwargs)
          except subprocess.CalledProcessError as ex:
              logger.error(ex.output)
              logger.error(error_msg)
              raise
          logger.debug("%s", out)
docs: run provided command and log all of its output; set path to ostree repo