#!/usr/bin/env python from __future__ import absolute_import from __future__ import print_function import os import optparse import sys tools_dir = os.path.dirname(os.path.abspath(__file__)) root_dir = os.path.dirname(tools_dir) sys.path.insert(0, root_dir) from tools.lib.test_script import ( get_provisioning_status, ) def run(): # type: () -> None parser = optparse.OptionParser() parser.add_option('--force', default=False, action="store_true", help='Run tests despite possible problems.') (options, args) = parser.parse_args() if not options.force: ok, msg = get_provisioning_status() if not ok: print(msg) print('If you really know what you are doing, use --force to run anyway.') sys.exit(1) if __name__ == '__main__': run()