From 05dc30dacd4ef0b409a26eac02419d3a604d0548 Mon Sep 17 00:00:00 2001 From: hongyuzhao Date: Tue, 20 Aug 2019 12:10:32 +0800 Subject: Add logout msb process before registering msb Change-Id: I58df6203d678f984952deb7aff1d94952036017f Issue-ID: VFC-1431 Signed-off-by: hongyuzhao --- lcm/lcm/pub/config/config.py | 1 + lcm/lcm/urls.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lcm/lcm/pub/config/config.py b/lcm/lcm/pub/config/config.py index 63c1784d..5023aefa 100644 --- a/lcm/lcm/pub/config/config.py +++ b/lcm/lcm/pub/config/config.py @@ -53,3 +53,4 @@ REG_TO_MSB_REG_PARAM = { "ttl": 0 }] } +MSB_SVC_URL = "/api/microservices/v1/services/vnflcm/version/v1" diff --git a/lcm/lcm/urls.py b/lcm/lcm/urls.py index 438c9437..4ff7e862 100644 --- a/lcm/lcm/urls.py +++ b/lcm/lcm/urls.py @@ -15,7 +15,9 @@ from django.conf.urls import include, url from django.contrib import admin -from lcm.pub.config.config import REG_TO_MSB_WHEN_START, REG_TO_MSB_REG_URL, REG_TO_MSB_REG_PARAM +from lcm.pub.config.config import REG_TO_MSB_WHEN_START, REG_TO_MSB_REG_URL, REG_TO_MSB_REG_PARAM, \ + MSB_SVC_URL + urlpatterns = [ url(r'^api/vnflcm/v1/admin', admin.site.urls), @@ -30,4 +32,6 @@ urlpatterns = [ if REG_TO_MSB_WHEN_START: import json from lcm.pub.utils.restcall import req_by_msb + + req_by_msb(MSB_SVC_URL, "DELETE") req_by_msb(REG_TO_MSB_REG_URL, "POST", json.JSONEncoder().encode(REG_TO_MSB_REG_PARAM)) -- cgit 1.2.3-korg