diff options
author | fujinhua <fu.jinhua@zte.com.cn> | 2018-11-12 11:45:14 +0800 |
---|---|---|
committer | fujinhua <fu.jinhua@zte.com.cn> | 2018-11-12 11:45:14 +0800 |
commit | 98cb202da1f53b113e6f8e2eb3a4c2536eedb9c7 (patch) | |
tree | 772b4908aad9e11946b5efff8d962dbf8142b26d /gvnfmadapter | |
parent | cd2a316552b2c6f6de76c5b0c008119fa6f518b8 (diff) |
Fix vnf term req data get logic
Change-Id: I0be04a77a97557a55284f258ad683004ccf870e8
Issue-ID: VFC-1163
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
Diffstat (limited to 'gvnfmadapter')
-rw-r--r-- | gvnfmadapter/driver/interfaces/views.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gvnfmadapter/driver/interfaces/views.py b/gvnfmadapter/driver/interfaces/views.py index d246080..e6c26fc 100644 --- a/gvnfmadapter/driver/interfaces/views.py +++ b/gvnfmadapter/driver/interfaces/views.py @@ -112,10 +112,14 @@ class VnfTermInfo(APIView): logger.debug("Terminate vnf begin!") vnfm_id = vnfmid try: + term_type = ignorcase_get(request.data, "terminationType") input_data = { - "terminationType": ignorcase_get(request.data, "terminationType"), - "gracefulTerminationTimeout": ignorcase_get(request.data, "gracefulTerminationTimeout") + "terminationType": term_type.upper() if term_type else "FORCEFUL" } + term_timeout = ignorcase_get(request.data, "gracefulTerminationTimeout") + if term_timeout: + input_data["gracefulTerminationTimeout"] = int(term_timeout) + logger.debug("do_terminatevnf: vnfm_id=[%s],vnfInstanceId=[%s],input_data=[%s]", vnfm_id, vnfInstanceId, input_data) resp = do_terminatevnf(vnfm_id, vnfInstanceId, input_data) |