Skip to content

Commit

Permalink
Retry on destroy network
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravid Brown committed Jan 4, 2018
1 parent a1f6cef commit 058ca8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ requests>=2.6.0
tabulate>=0.7.5
six>=1.10.0
urllib3>=1.22
retry
5 changes: 4 additions & 1 deletion skipper/runner.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import grp
import getpass
import grp
import logging
import os
import subprocess
from contextlib import contextmanager

from retry import retry


# pylint: disable=too-many-arguments
def run(command, fqdn_image=None, environment=None, interactive=False, name=None, net='host', volumes=None, workdir=None, use_cache=False):
Expand Down Expand Up @@ -102,6 +104,7 @@ def _create_network(net):
subprocess.check_output(['docker', 'network', 'create', net]).decode()


@retry(delay=0.1)
def _destroy_network(net):
logging.debug("Deleting network %(net)s", dict(net=net))
subprocess.check_output(['docker', 'network', 'rm', net]).decode()
Expand Down

0 comments on commit 058ca8b

Please sign in to comment.