From 25f80a447813765f4a43f98da7682f4b5f8ea401 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 30 May 2021 00:09:39 -0400 Subject: [PATCH] Move API version string location to Daemon Prevents a startup bug with pvcapid-manage.py. --- api-daemon/pvcapid/Daemon.py | 7 +++++-- api-daemon/pvcapid/flaskapi.py | 5 +---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api-daemon/pvcapid/Daemon.py b/api-daemon/pvcapid/Daemon.py index 55b7fcba..cd65efd5 100755 --- a/api-daemon/pvcapid/Daemon.py +++ b/api-daemon/pvcapid/Daemon.py @@ -24,9 +24,12 @@ import yaml from distutils.util import strtobool as dustrtobool -# Version string for startup output +# Daemon version version = '0.9.18' +# API version +API_VERSION = 1.0 + ########################################################## # Helper Functions @@ -123,7 +126,7 @@ print('| ## ## ## ## ## |') print('| ## ### ###### |') print('|--------------------------------------------------|') print('| Parallel Virtual Cluster API daemon v{0: <11} |'.format(version)) -print('| API version: v{0: <34} |'.format(pvc_api.API_VERSION)) +print('| API version: v{0: <34} |'.format(API_VERSION)) print('| Listen: {0: <40} |'.format('{}:{}'.format(config['listen_address'], config['listen_port']))) print('| SSL: {0: <43} |'.format(str(config['ssl_enabled']))) print('| Authentication: {0: <32} |'.format(str(config['auth_enabled']))) diff --git a/api-daemon/pvcapid/flaskapi.py b/api-daemon/pvcapid/flaskapi.py index cf4e5c4c..ff1f7843 100755 --- a/api-daemon/pvcapid/flaskapi.py +++ b/api-daemon/pvcapid/flaskapi.py @@ -25,7 +25,7 @@ from functools import wraps from flask_restful import Resource, Api, reqparse, abort from celery import Celery -from pvcapid.Daemon import config, strtobool +from pvcapid.Daemon import config, strtobool, API_VERSION import pvcapid.helper as api_helper import pvcapid.provisioner as api_provisioner @@ -34,9 +34,6 @@ import pvcapid.ova as api_ova from flask_sqlalchemy import SQLAlchemy -# API version -API_VERSION = 1.0 - # Create Flask app and set config values app = flask.Flask(__name__)