diff --git a/tools/run-dev.py b/tools/run-dev.py index 896af46436..b45407424f 100755 --- a/tools/run-dev.py +++ b/tools/run-dev.py @@ -38,6 +38,13 @@ behavior, the reverse proxy itself does *not* automatically restart on changes to this file. """) + +TOOLS_DIR = os.path.dirname(os.path.abspath(__file__)) +sys.path.insert(0, os.path.dirname(TOOLS_DIR)) +from tools.lib.test_script import( + get_provisioning_status, +) + parser.add_option('--test', action='store_true', dest='test', help='Use the testing database and ports') @@ -50,8 +57,19 @@ parser.add_option('--no-clear-memcached', action='store_false', dest='clear_memcached', default=True, help='Do not clear memcached') +parser.add_option('--force', dest='force', + action="store_true", + default=False, help='Run tests despite possible problems.') + (options, arguments) = 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 options.interface is None: user_id = os.getuid() user_name = pwd.getpwuid(user_id).pw_name