diff --git a/koji-containerbuild-0.6.1-1-popen-osbs.patch b/koji-containerbuild-0.6.1-1-popen-osbs.patch index 78a8772..5d94f30 100644 --- a/koji-containerbuild-0.6.1-1-popen-osbs.patch +++ b/koji-containerbuild-0.6.1-1-popen-osbs.patch @@ -11,13 +11,13 @@ index 677dae7..71f42f2 100644 +# subprocess.Popen patch +import subprocess +import json - + # We need kojid module which isn't proper python module and not even in # site-package path. @@ -255,7 +260,6 @@ class CreateContainerTask(BaseTaskHandler): workdir) self._osbs = None - + - def osbs(self): """Handler of OSBS object""" @@ -28,7 +28,7 @@ index 677dae7..71f42f2 100644 } + + # subprocess.Popen patch -+ cmd = "osbs --output json build" ++ cmd = "osbs --output json build --no-logs" + cmd += " --git-url %s" % create_build_args["git_uri"] + cmd += " --git-commit %s" % create_build_args["git_ref"] + cmd += " --user %s" % create_build_args["user"] @@ -75,7 +75,7 @@ index 677dae7..71f42f2 100644 + build_id = json.loads(sp_out)['metadata']['name'] + self.logger.debug("OSBS build id: %r", build_id) - + - self.logger.debug("Waiting for osbs build_id: %s to be scheduled.", - build_id) - # we need to wait for kubelet to schedule the build, otherwise it's 500 @@ -88,13 +88,13 @@ index 677dae7..71f42f2 100644 + ## we need to wait for kubelet to schedule the build, otherwise it's 500 + #self.osbs().wait_for_build_to_get_scheduled(build_id) self.logger.debug("Build was scheduled") - + osbs_logs_dir = self.resultdir() koji.ensuredir(osbs_logs_dir) - pid = os.fork() - if pid: - self._incremental_upload_logs(pid) - + - else: - full_output_name = os.path.join(osbs_logs_dir, - 'openshift-incremental.log') @@ -190,14 +190,14 @@ index 677dae7..71f42f2 100644 + ) + sp_out, sp_err = subproc.communicate() + response = BuildResponse(json.loads(sp_out)) # get the response - + - response = self.osbs().wait_for_build_to_finish(build_id) self.logger.debug("OSBS build finished with status: %s. Build " "response: %s.", response.status, response.json) @@ -630,7 +692,16 @@ class BuildContainerTask(BaseTaskHandler): return report - + def _raise_if_image_failed(self, osbs_build_id): - build = self.osbs().get_build(osbs_build_id) + # subprocess.Popen patch diff --git a/koji-containerbuild.spec b/koji-containerbuild.spec index 3588e97..1cb5f9c 100644 --- a/koji-containerbuild.spec +++ b/koji-containerbuild.spec @@ -7,7 +7,7 @@ Name: koji-containerbuild Version: 0.6.1 -Release: 1.1%{?dist} +Release: 1.2%{?dist} Summary: Koji support for building layered container images Group: Applications/System @@ -122,6 +122,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Apr 25 2016 Adam Miller - 0.6.1-1.2 +- Fix patch for popen osbs cmd to get correct json output + * Mon Apr 25 2016 Adam Miller - 0.6.1-1.1 - Add patch for popen osbs, fix deps for builder