Commit 3414bdc1 authored by Manuel's avatar Manuel

businessLogic: updated local mode

parent cfa062b9
...@@ -12,6 +12,7 @@ if os.path.exists(modules_path): ...@@ -12,6 +12,7 @@ if os.path.exists(modules_path):
# load swagger config # load swagger config
import connexion import connexion
from security import swagger_util from security import swagger_util
from env_info import is_running_locally
app = connexion.App(__name__, specification_dir='configs/') app = connexion.App(__name__, specification_dir='configs/')
...@@ -28,16 +29,17 @@ except KeyError: ...@@ -28,16 +29,17 @@ except KeyError:
certificate_path = '/srv/articonf/' certificate_path = '/srv/articonf/'
context = (os.path.normpath(f'{certificate_path}/articonf1.crt'), os.path.normpath(f'{certificate_path}/articonf1.key')) # certificate and key files context = (os.path.normpath(f'{certificate_path}/articonf1.crt'), os.path.normpath(f'{certificate_path}/articonf1.key')) # certificate and key files
# Local Mode if is_running_locally():
try: # Local Mode
print("Running with local settings...") print("Running with local settings...")
local = os.environ['ARTICONF_LOCAL']
app.add_api(swagger_util.get_bundled_specs(Path("configs/swagger_local.yml")), app.add_api(swagger_util.get_bundled_specs(Path("configs/swagger_local.yml")),
resolver = connexion.RestyResolver("cms_rest_api")) resolver = connexion.RestyResolver("cms_rest_api"))
except KeyError: context = 'adhoc'
else:
app.add_api(swagger_util.get_bundled_specs(Path("configs/swagger.yml")), app.add_api(swagger_util.get_bundled_specs(Path("configs/swagger.yml")),
resolver = connexion.RestyResolver("cms_rest_api")) resolver = connexion.RestyResolver("cms_rest_api"))
# start app # start app
if __name__ == '__main__': if __name__ == '__main__':
print(context)
app.run(host='0.0.0.0', port=5000, debug=False, ssl_context=context) app.run(host='0.0.0.0', port=5000, debug=False, ssl_context=context)
...@@ -2,11 +2,13 @@ astroid==2.4.2 ...@@ -2,11 +2,13 @@ astroid==2.4.2
attrs==19.3.0 attrs==19.3.0
autopep8==1.5.4 autopep8==1.5.4
certifi==2020.6.20 certifi==2020.6.20
cffi==1.14.2
chardet==3.0.4 chardet==3.0.4
click==7.1.2 click==7.1.2
clickclick==1.2.2 clickclick==1.2.2
colorama==0.4.3 colorama==0.4.3
connexion==2.7.0 connexion==2.7.0
cryptography==3.1
Flask==1.1.2 Flask==1.1.2
idna==2.10 idna==2.10
importlib-metadata==1.7.0 importlib-metadata==1.7.0
...@@ -21,11 +23,13 @@ mccabe==0.6.1 ...@@ -21,11 +23,13 @@ mccabe==0.6.1
openapi-spec-validator==0.2.9 openapi-spec-validator==0.2.9
prance==0.19.0 prance==0.19.0
pycodestyle==2.6.0 pycodestyle==2.6.0
pycparser==2.20
pylint==2.5.3 pylint==2.5.3
pymongo==3.11.0 pymongo==3.11.0
pyrsistent==0.16.0 pyrsistent==0.16.0
PyYAML==5.3.1 PyYAML==5.3.1
requests==2.24.0 requests==2.24.0
rope==0.17.0
semver==2.10.2 semver==2.10.2
six==1.15.0 six==1.15.0
swagger-ui-bundle==0.0.8 swagger-ui-bundle==0.0.8
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment