Check provision version in run-dev.py.

Don't start run-dev.py if the provisioning version is
incorrect.
This commit is contained in:
Shashank 2016-11-07 12:36:34 +05:30 committed by Steve Howell
parent eade575267
commit 702d3cf103
1 changed files with 18 additions and 0 deletions

View File

@ -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