def ensure_latest_consul_release(host=None, port=22):
"""
Make sure the latest consul release is downloaded on the remote machine
:param str host: hostname or ip of the remote machine, or None for the local machine
:param int port: port to use to connect to the remote machine over ssh
:return None:
"""
log.info("Ensuring consul release {} is on disk "
"on the remote machine".format(CONSUL_RELEASE.split('/')[-1]))
with suppress(FileNotFoundError):
# remove any previously existing zip in case we tried
# before but the zip was corrupted
remove(CONSUL_RELEASE.split('/')[-1])
wget(
CONSUL_RELEASE, host=host, port=port,
failure_message="Failed to retrieve {}".format(
CONSUL_RELEASE.split('/')[-1]
)
)
评论列表
文章目录