fix template provisioning by verifying VM is provisioned before doing anything else

This commit is contained in:
Jordan Rodgers 2019-01-27 21:43:51 -05:00
parent 84f9a00735
commit 1acb84016d
5 changed files with 49 additions and 28 deletions

View file

@ -16,12 +16,11 @@ app.config.from_pyfile(config)
def start_websockify(websockify_path, target_file):
result = subprocess.run(['pgrep', 'websockify'], stdout=subprocess.PIPE)
if not result.stdout:
subprocess.call(
[
websockify_path, '8081', '--token-plugin', 'TokenFile',
'--token-source', target_file, '-D'
],
stdout=subprocess.PIPE)
subprocess.call([
websockify_path, '8081', '--token-plugin', 'TokenFile',
'--token-source', target_file, '-D'
],
stdout=subprocess.PIPE)
def on_starting(server):