Flag to skip all pull errors when pulling images.

Signed-off-by: Vojta Orgon <villlem@gmail.com>
This commit is contained in:
Vojta Orgon 2015-09-21 11:59:23 +02:00
commit c9083e21c8
8 changed files with 31 additions and 5 deletions

View file

@ -270,6 +270,7 @@ class TopLevelCommand(Command):
Usage: pull [options] [SERVICE...]
Options:
--ignore-pull-failures Pull what it can and ignores images with pull failures.
--allow-insecure-ssl Deprecated - no effect.
"""
if options['--allow-insecure-ssl']:
@ -277,6 +278,7 @@ class TopLevelCommand(Command):
project.pull(
service_names=options['SERVICE'],
ignore_pull_failures=options.get('--ignore-pull-failures')
)
def rm(self, project, options):

View file

@ -311,9 +311,9 @@ class Project(object):
return plans
def pull(self, service_names=None):
def pull(self, service_names=None, ignore_pull_failures=False):
for service in self.get_services(service_names, include_deps=True):
service.pull()
service.pull(ignore_pull_failures)
def containers(self, service_names=None, stopped=False, one_off=False):
if service_names:

View file

@ -769,7 +769,7 @@ class Service(object):
return True
return False
def pull(self):
def pull(self, ignore_pull_failures=False):
if 'image' not in self.options:
return
@ -781,7 +781,14 @@ class Service(object):
tag=tag,
stream=True,
)
stream_output(output, sys.stdout)
try:
stream_output(output, sys.stdout)
except StreamOutputError as e:
if not ignore_pull_failures:
raise
else:
log.error(six.text_type(e))
class Net(object):