plugins/docker_daemon: flake8

This commit is contained in:
Johan Euphrosine 2014-11-19 16:25:27 -08:00
parent e53e727c9c
commit 99786539c7

View file

@ -4,10 +4,11 @@ from bootstrapvz.common.tasks import boot
from bootstrapvz.common.tasks import initd from bootstrapvz.common.tasks import initd
from bootstrapvz.common.tools import log_check_call from bootstrapvz.common.tools import log_check_call
from bootstrapvz.providers.gce.tasks import boot as gceboot from bootstrapvz.providers.gce.tasks import boot as gceboot
from bootstrapvz.plugins.docker_daemon.pull import pull
import os import os
import os.path import os.path
import shutil import shutil
import subprocess
import time
ASSETS_DIR = os.path.normpath(os.path.join(os.path.dirname(__file__), 'assets')) ASSETS_DIR = os.path.normpath(os.path.join(os.path.dirname(__file__), 'assets'))
@ -92,12 +93,12 @@ class PullDockerImages(Task):
for img in images: for img in images:
if img.endswith('.tar.gz') or img.endswith('.tgz'): if img.endswith('.tar.gz') or img.endswith('.tgz'):
cmd = [bin_docker, '-H', socket, 'load', '-i', img] cmd = [bin_docker, '-H', socket, 'load', '-i', img]
if lock_check_call(cmd) != 0: if log_check_call(cmd) != 0:
msg = 'error loading docker image {img}.'.format(img=img) msg = 'error loading docker image {img}.'.format(img=img)
raise Exception(msg) raise Exception(msg)
else: # regular docker image else: # regular docker image
cmd = [bin_docker, '-H', socket, 'pull', img] cmd = [bin_docker, '-H', socket, 'pull', img]
if lock_check_call(cmd) != 0: if log_check_call(cmd) != 0:
msg = 'error pulling docker image {img}.'.format(img=img) msg = 'error pulling docker image {img}.'.format(img=img)
raise Exception(msg) raise Exception(msg)
finally: finally: