Message ID | 20170712075528.22770-2-famz@redhat.com |
---|---|
State | New |
Headers | show |
On 07/12/2017 04:55 AM, Fam Zheng wrote: > The **kwargs can do this just well. > > Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> > --- > tests/docker/docker.py | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/tests/docker/docker.py b/tests/docker/docker.py > index e707e5b..f5ac86b 100755 > --- a/tests/docker/docker.py > +++ b/tests/docker/docker.py > @@ -112,11 +112,9 @@ class Docker(object): > signal.signal(signal.SIGTERM, self._kill_instances) > signal.signal(signal.SIGHUP, self._kill_instances) > > - def _do(self, cmd, quiet=True, infile=None, **kwargs): > + def _do(self, cmd, quiet=True, **kwargs): > if quiet: > kwargs["stdout"] = DEVNULL > - if infile: > - kwargs["stdin"] = infile > return subprocess.call(self._command + cmd, **kwargs) > > def _do_kill_instances(self, only_known, only_active=True): > @@ -184,7 +182,7 @@ class Docker(object): > def update_image(self, tag, tarball, quiet=True): > "Update a tagged image using " > > - self._do(["build", "-t", tag, "-"], quiet=quiet, infile=tarball) > + self._do(["build", "-t", tag, "-"], quiet=quiet, stdin=tarball) > > def image_matches_dockerfile(self, tag, dockerfile): > try: >
diff --git a/tests/docker/docker.py b/tests/docker/docker.py index e707e5b..f5ac86b 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -112,11 +112,9 @@ class Docker(object): signal.signal(signal.SIGTERM, self._kill_instances) signal.signal(signal.SIGHUP, self._kill_instances) - def _do(self, cmd, quiet=True, infile=None, **kwargs): + def _do(self, cmd, quiet=True, **kwargs): if quiet: kwargs["stdout"] = DEVNULL - if infile: - kwargs["stdin"] = infile return subprocess.call(self._command + cmd, **kwargs) def _do_kill_instances(self, only_known, only_active=True): @@ -184,7 +182,7 @@ class Docker(object): def update_image(self, tag, tarball, quiet=True): "Update a tagged image using " - self._do(["build", "-t", tag, "-"], quiet=quiet, infile=tarball) + self._do(["build", "-t", tag, "-"], quiet=quiet, stdin=tarball) def image_matches_dockerfile(self, tag, dockerfile): try:
The **kwargs can do this just well. Signed-off-by: Fam Zheng <famz@redhat.com> --- tests/docker/docker.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)