aboutsummaryrefslogtreecommitdiffstats
path: root/osdfapp.py
diff options
context:
space:
mode:
authorRuoyu Ying <ruoyu.ying@intel.com>2019-04-05 01:55:44 +0800
committerRuoyu Ying <ruoyu.ying@intel.com>2019-04-05 02:21:31 +0800
commit0e957e6ff4bae412ba909f9677d485d4abc0362b (patch)
tree12ae1fe6b3a2683db674e1508ee7325674a66e0b /osdfapp.py
parentff08e67156aa736081d8b8671882cf78d3b6f668 (diff)
Automate the process of policy model uploading
Add one more step after doing the healthcheck to upload all the models under /osdf/models/policy/placement/tosca Change-Id: I140efba27d603f43f6ae3f73b73b860dc8b10b42 Issue-ID: OPTFRA-415 Signed-off-by: Ruoyu Ying <ruoyu.ying@intel.com>
Diffstat (limited to 'osdfapp.py')
-rwxr-xr-xosdfapp.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/osdfapp.py b/osdfapp.py
index 9449bc9..cebedc2 100755
--- a/osdfapp.py
+++ b/osdfapp.py
@@ -39,6 +39,7 @@ from schematics.exceptions import DataError
from requests import RequestException
from optparse import OptionParser
from osdf.adapters.policy.interface import get_policies
+from osdf.adapters.policy.interface import upload_policy_models
from osdf.config.base import osdf_config
from osdf.optimizers.placementopt.conductor.remote_opt_processor import process_placement_opt
from osdf.webapp.appcontroller import auth_basic
@@ -103,6 +104,9 @@ def handle_data_error(e):
def do_osdf_health_check():
"""Simple health check"""
audit_log.info("A health check request is processed!")
+ """Upload policy models"""
+ response = upload_policy_models()
+ audit_log.info(response)
return "OK"