It's legacy code from open-o, we don't need it any more.
And also remove a vulnerability reported by sonar.
Change-Id: I88c94240c0ef21b182b8dcc13feae684471639db
Issue-ID: MULTICLOUD-133
Signed-off-by: Ethan Lynn <ethanlynnl@vmware.com>
# [IMAGE LOCAL PATH]
ROOT_PATH = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-
-# [register]
-REG_TO_MSB_WHEN_START = False
-REG_TO_MSB_REG_URL = "/api/microservices/v1/services"
-REG_TO_MSB_REG_PARAM = {
- "serviceName": "multicloud",
- "version": "v0",
- "url": "/api/multicloud/v0",
- "protocol": "REST",
- "visualRange": "1",
- "nodes": [{
- "ip": "127.0.0.1",
- "port": "9001",
- "ttl": 0
- }]
-}
if 'test' in sys.argv:
from multivimbroker.pub.config import config
- config.REG_TO_MSB_WHEN_START = False
DATABASES = {}
DATABASES['default'] = {
'ENGINE': 'django.db.backends.sqlite3',
+++ /dev/null
-# Copyright (c) 2017-2018 VMware, Inc.
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
-import json
-import mock
-import unittest
-
-from multivimbroker.pub.config import config
-from multivimbroker import urls
-
-
-class TestUrls(unittest.TestCase):
-
- def test_request_msb(self):
- with mock.patch("multivimbroker.pub.utils.restcall."
- "req_by_msb") as req_by_msb:
- urls.req_msb(True)
- req_by_msb.assert_called_once_with(
- config.REG_TO_MSB_REG_URL, "POST",
- json.JSONEncoder().encode(config.REG_TO_MSB_REG_PARAM))
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
from django.conf.urls import include, url
-import json
-
-from multivimbroker.pub.config import config
-
urlpatterns = [
url(r'^', include('multivimbroker.swagger.urls')),
url(r'^', include('multivimbroker.forwarder.urls')),
]
-
-
-def req_msb(request_when_start):
- # regist to MSB when startup
- if request_when_start:
- from multivimbroker.pub.utils.restcall import req_by_msb
- req_by_msb(config.REG_TO_MSB_REG_URL, "POST",
- json.JSONEncoder().encode(config.REG_TO_MSB_REG_PARAM))
-
-
-req_msb(config.REG_TO_MSB_WHEN_START)