def ensure_bosh():
bosh_exec = spawn.find_executable('bosh')
## check the version
## bosh --version
## version 2.0.1-74fad57-2017-02-15T20:17:00Z
##
## Succeeded
## bosh --version
## BOSH 1.3262.26.0
if not bosh_exec:
print("'bosh' command should be on the path. See https://bosh.io for installation instructions")
sys.exit(1)
if bosh_exec:
output = subprocess.check_output(["bosh", "--version"], stderr=subprocess.STDOUT, cwd=".")
if not output.startswith("version 2."):
print("You are running older bosh version. Please upgrade to 'bosh 2.0' command should be on the path. See https://bosh.io/docs/cli-v2.html for installation instructions")
sys.exit(1)
评论列表
文章目录