Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #110 from shuhaowu/flexible-ip-wait-timeout
Browse files Browse the repository at this point in the history
Allow wait timeout to be changed for IP
  • Loading branch information
robvdl committed Mar 10, 2018
2 parents 86e6c7d + 444dd31 commit 045eab4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lxdock/conf/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ def get_schema():
'password': str,
'shell': str,
}],
'extras': {
'network_wait_timeout': int
}
}

def _check_provisioner_config(config):
Expand Down
5 changes: 3 additions & 2 deletions lxdock/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,9 @@ def _setup_ip(self):
""" Setup the IP address of the considered container. """
ip = get_ip(self._container)
if not ip:
logger.info('No IP yet, waiting for at most 10 seconds...')
ip = self._wait_for_ip()
network_wait_timeout = self.options.get("extras", {}).get("network_wait_timeout", 10)
logger.info('No IP yet, waiting for at most {} seconds...'.format(network_wait_timeout))
ip = self._wait_for_ip(network_wait_timeout)
if not ip:
logger.warn('STILL no IP! Container is up, but probably broken.')
logger.info('Maybe that restarting it will help? Not trying to provision.')
Expand Down

0 comments on commit 045eab4

Please sign in to comment.