Skip to content

Commit

Permalink
Added black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartLens committed Dec 12, 2020
1 parent 6d930d9 commit 8d23e1f
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/popper/runner_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ def _create_container(self, cid, step):
log.info(f"[{step.id}] docker build {img}:{tag} {build_ctx_path}")
if not self._config.dry_run:
streamer = self._d.api.build(
decode=True, path=build_ctx_path, tag=f"{img}:{tag}", rm=True,
decode=True,
path=build_ctx_path,
tag=f"{img}:{tag}",
rm=True,
)
for chunk in streamer:
if self._config.quiet:
Expand All @@ -194,21 +197,22 @@ def _create_container(self, cid, step):
log.info(f"[{step.id}] docker pull {img}:{tag}")
if not self._config.dry_run:
streamer = self._d.api.pull(
repository=f"{img}:{tag}", decode=True,
repository=f"{img}:{tag}",
decode=True,
)

for chunk in streamer.splitlines():
if self._config.quiet:
continue
chunk = chunk.strip()
if chunk:
import json

chunk = json.loads(chunk)
if 'id' in chunk:
log.step_info(chunk['id'] + ': ' + chunk['status'])
if "id" in chunk:
log.step_info(chunk["id"] + ": " + chunk["status"])
else:
log.step_info(chunk['status'])

log.step_info(chunk["status"])

if self._config.dry_run:
return
Expand Down

0 comments on commit 8d23e1f

Please sign in to comment.