summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lcm/.gitignore4
-rwxr-xr-xlcm/initialize.sh1
-rw-r--r--lcm/lcm/nf/__init__.py2
-rw-r--r--lcm/lcm/nf/vnfs/const.py29
-rw-r--r--lcm/lcm/nf/vnfs/swagger.json2
-rw-r--r--lcm/lcm/nf/vnfs/tests/__init__.py2
-rw-r--r--lcm/lcm/nf/vnfs/tests/test_vnf_cancel.py27
-rw-r--r--lcm/lcm/nf/vnfs/tests/test_vnf_create.py1
-rw-r--r--lcm/lcm/nf/vnfs/tests/test_vnf_query.py1
-rw-r--r--lcm/lcm/nf/vnfs/views.py1
-rw-r--r--lcm/lcm/nf/vnfs/vnf_cancel/__init__.py2
-rw-r--r--lcm/lcm/nf/vnfs/vnf_cancel/delete_vnf_identifier.py1
-rw-r--r--lcm/lcm/nf/vnfs/vnf_cancel/term_vnf.py1
-rw-r--r--lcm/lcm/nf/vnfs/vnf_create/create_vnf_identifier.py1
-rw-r--r--lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py1
-rw-r--r--lcm/lcm/pub/aaiapi/aai.py50
-rw-r--r--lcm/lcm/pub/config/config.py1
-rw-r--r--lcm/lcm/pub/database/models.py1
-rw-r--r--lcm/lcm/pub/exceptions.py2
-rw-r--r--lcm/lcm/pub/msapi/gvnfmdriver.py1
-rw-r--r--lcm/lcm/pub/utils/restcall.py2
-rw-r--r--lcm/lcm/pub/utils/toscautil_new.py4
-rw-r--r--lcm/lcm/pub/utils/values.py2
-rw-r--r--lcm/lcm/samples/resources.py1
-rw-r--r--lcm/lcm/settings.py1
-rwxr-xr-xlcm/run.sh1
-rwxr-xr-xlcm/stop.sh1
-rw-r--r--lcm/version.properties15
28 files changed, 103 insertions, 55 deletions
diff --git a/lcm/.gitignore b/lcm/.gitignore
new file mode 100644
index 00000000..b7dfabf9
--- /dev/null
+++ b/lcm/.gitignore
@@ -0,0 +1,4 @@
+../.idea
+logs/runtime_lcm.log
+*.pyc
+bash.exe.stackdump
diff --git a/lcm/initialize.sh b/lcm/initialize.sh
index 7ace3828..3425019b 100755
--- a/lcm/initialize.sh
+++ b/lcm/initialize.sh
@@ -12,4 +12,5 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
pip install -r requirements.txt
diff --git a/lcm/lcm/nf/__init__.py b/lcm/lcm/nf/__init__.py
index 650d17ec..c7b6818e 100644
--- a/lcm/lcm/nf/__init__.py
+++ b/lcm/lcm/nf/__init__.py
@@ -10,4 +10,4 @@
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
-# limitations under the License. \ No newline at end of file
+# limitations under the License.
diff --git a/lcm/lcm/nf/vnfs/const.py b/lcm/lcm/nf/vnfs/const.py
index 3967eaeb..bb114e4a 100644
--- a/lcm/lcm/nf/vnfs/const.py
+++ b/lcm/lcm/nf/vnfs/const.py
@@ -18,6 +18,7 @@ VNF_STATUS = enum(NULL='null', INSTANTIATING="instantiating", INACTIVE='inactive
FAILED="failed", TERMINATING="terminating", SCALING="scaling", OPERATING="operating",
UPDATING="updating", HEALING="healing")
+# inst_req_data
inst_req_data = {
"flavourId": "flavour_1",
"instantiationLevelId": "instantiationLevel_1",
@@ -83,6 +84,8 @@ inst_req_data = {
}]}
}
+
+# vnfd_rawdata
vnfd_rawdata = {
"rawData": {
"instance": {
@@ -350,7 +353,7 @@ vnfd_rawdata = {
}
}
-
+# vnfd_model_dict
vnfd_model_dict = {
'metadata': {
'vendor': u'zte',
@@ -660,7 +663,8 @@ vnfd_model_dict = {
],
}
-c1_data_get_tenant_id = { # get_tenant_id
+# get_tenant_id
+c1_data_get_tenant_id = {
"tenants": [
{
"id": "1",
@@ -668,6 +672,8 @@ c1_data_get_tenant_id = { # get_tenant_id
}
]
}
+
+# create_volume
c2_data_create_volume = {
"id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
"name": "volume1",
@@ -682,7 +688,9 @@ c2_data_create_volume = {
"type": None,
"size": 40
}
-c3_data_get_volume = { # get_volume
+
+# get_volume
+c3_data_get_volume = {
"status": "available",
"name": "wangsong",
"attachments": [
@@ -699,7 +707,9 @@ c3_data_get_volume = { # get_volume
"id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
"size": 40
}
-c4_data_create_network = { # create_network
+
+# create_network
+c4_data_create_network = {
"returnCode": 0,
"vimId": "11111",
"vimName": "11111",
@@ -715,6 +725,8 @@ c4_data_create_network = { # create_network
"physicalNetwork": "ctrl",
"routerExternal": False
}
+
+# create_subnet
c5_data_create_subnet = {
"returnCode": 0,
"vimId": "11111",
@@ -738,6 +750,8 @@ c5_data_create_subnet = {
],
"hostRoutes": []
}
+
+# create_ports
c6_data_create_port = {
"returnCode": 0,
"vimId": "11111",
@@ -755,6 +769,8 @@ c6_data_create_port = {
"vnicType": "normal",
"securityGroups": ""
}
+
+# create_flavor
c7_data_create_flavor ={
"returnCode": 0,
"vimId": "11111",
@@ -771,6 +787,7 @@ c7_data_create_flavor ={
"extraSpecs": "testtt"
}
+# list_image
c8_data_list_image = {
"vimid": "",
"vimname": "",
@@ -783,6 +800,8 @@ c8_data_list_image = {
}
]
}
+
+# create_vm
c9_data_create_vm = {
"returnCode": 1,
"id": "3c9eebdbbfd345658269340b9ea6fb73",
@@ -800,6 +819,8 @@ c9_data_create_vm = {
"serverGroup": "fdvfdv",
"status": "ACTIVE"
}
+
+# get_vm
c10_data_get_vm = {
"returnCode": 1,
"id": "3c9eebdbbfd345658269340b9ea6fb73",
diff --git a/lcm/lcm/nf/vnfs/swagger.json b/lcm/lcm/nf/vnfs/swagger.json
index ce8ae687..4c9c8dd2 100644
--- a/lcm/lcm/nf/vnfs/swagger.json
+++ b/lcm/lcm/nf/vnfs/swagger.json
@@ -1064,4 +1064,4 @@
}
}
}
-} \ No newline at end of file
+}
diff --git a/lcm/lcm/nf/vnfs/tests/__init__.py b/lcm/lcm/nf/vnfs/tests/__init__.py
index 650d17ec..c7b6818e 100644
--- a/lcm/lcm/nf/vnfs/tests/__init__.py
+++ b/lcm/lcm/nf/vnfs/tests/__init__.py
@@ -10,4 +10,4 @@
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
-# limitations under the License. \ No newline at end of file
+# limitations under the License.
diff --git a/lcm/lcm/nf/vnfs/tests/test_vnf_cancel.py b/lcm/lcm/nf/vnfs/tests/test_vnf_cancel.py
index 8cdfb7f2..4f27cee0 100644
--- a/lcm/lcm/nf/vnfs/tests/test_vnf_cancel.py
+++ b/lcm/lcm/nf/vnfs/tests/test_vnf_cancel.py
@@ -1,16 +1,17 @@
-# # Copyright 2017 ZTE Corporation.
-# #
-# # 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.
-# # See the License for the specific language governing permissions and
-# # limitations under the License.
+# Copyright 2017 ZTE Corporation.
+#
+# 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.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
import json
import uuid
diff --git a/lcm/lcm/nf/vnfs/tests/test_vnf_create.py b/lcm/lcm/nf/vnfs/tests/test_vnf_create.py
index d4d5d77c..aebfdb3b 100644
--- a/lcm/lcm/nf/vnfs/tests/test_vnf_create.py
+++ b/lcm/lcm/nf/vnfs/tests/test_vnf_create.py
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
import json
import uuid
diff --git a/lcm/lcm/nf/vnfs/tests/test_vnf_query.py b/lcm/lcm/nf/vnfs/tests/test_vnf_query.py
index 5141ff88..7f21d47b 100644
--- a/lcm/lcm/nf/vnfs/tests/test_vnf_query.py
+++ b/lcm/lcm/nf/vnfs/tests/test_vnf_query.py
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
from django.test import TestCase, Client
from rest_framework import status
diff --git a/lcm/lcm/nf/vnfs/views.py b/lcm/lcm/nf/vnfs/views.py
index 8b026e5c..1062d3a1 100644
--- a/lcm/lcm/nf/vnfs/views.py
+++ b/lcm/lcm/nf/vnfs/views.py
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
import json
import logging
import os
diff --git a/lcm/lcm/nf/vnfs/vnf_cancel/__init__.py b/lcm/lcm/nf/vnfs/vnf_cancel/__init__.py
index 650d17ec..c7b6818e 100644
--- a/lcm/lcm/nf/vnfs/vnf_cancel/__init__.py
+++ b/lcm/lcm/nf/vnfs/vnf_cancel/__init__.py
@@ -10,4 +10,4 @@
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
-# limitations under the License. \ No newline at end of file
+# limitations under the License.
diff --git a/lcm/lcm/nf/vnfs/vnf_cancel/delete_vnf_identifier.py b/lcm/lcm/nf/vnfs/vnf_cancel/delete_vnf_identifier.py
index 91d92089..eede66f7 100644
--- a/lcm/lcm/nf/vnfs/vnf_cancel/delete_vnf_identifier.py
+++ b/lcm/lcm/nf/vnfs/vnf_cancel/delete_vnf_identifier.py
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
import logging
from lcm.pub.aaiapi.aai import delete_vnf
diff --git a/lcm/lcm/nf/vnfs/vnf_cancel/term_vnf.py b/lcm/lcm/nf/vnfs/vnf_cancel/term_vnf.py
index 8b17fd26..b9a5e66b 100644
--- a/lcm/lcm/nf/vnfs/vnf_cancel/term_vnf.py
+++ b/lcm/lcm/nf/vnfs/vnf_cancel/term_vnf.py
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
import json
import logging
import traceback
diff --git a/lcm/lcm/nf/vnfs/vnf_create/create_vnf_identifier.py b/lcm/lcm/nf/vnfs/vnf_create/create_vnf_identifier.py
index a91c8d02..d801a26e 100644
--- a/lcm/lcm/nf/vnfs/vnf_create/create_vnf_identifier.py
+++ b/lcm/lcm/nf/vnfs/vnf_create/create_vnf_identifier.py
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
import json
import logging
import uuid
diff --git a/lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py b/lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py
index d242bd8d..5ad002e0 100644
--- a/lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py
+++ b/lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
import json
import logging
import traceback
diff --git a/lcm/lcm/pub/aaiapi/aai.py b/lcm/lcm/pub/aaiapi/aai.py
index a70a5980..698b7c52 100644
--- a/lcm/lcm/pub/aaiapi/aai.py
+++ b/lcm/lcm/pub/aaiapi/aai.py
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
import json
import logging
@@ -23,34 +24,34 @@ logger = logging.getLogger(__name__)
def call_aai(resource, method, data=''):
return call_req_aai(AAI_BASE_URL, AAI_USER, AAI_PASSWORD, rest_no_auth, resource, method, data)
+
def create_ns(global_customer_id, service_type, service_instance_id, data):
resource = "/business/customers/customer/%s/service-subscriptions/service-subscription/" \
"%s/service-instances/service-instance/%s" % \
(global_customer_id, service_type, service_instance_id)
ret = call_aai(resource, "PUT", data)
- # ret = call_req_aai(AAI_BASE_URL, AAI_USER, AAI_PASSWORD, rest_no_auth, resource, "PUT", data)
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise NFLCMException("Ns instance creation exception in AAI")
return json.JSONDecoder().decode(ret[1])
-def delete_ns(global_customer_id, service_type, service_instance_id, data):
+
+def delete_ns(global_customer_id, service_type, service_instance_id):
resource = "/business/customers/customer/%s/service-subscriptions/service-subscription/" \
"%s/service-instances/service-instance/%s" % \
(global_customer_id, service_type, service_instance_id)
- ret = call_aai(resource, "DELETE", data)
- # ret = call_req_aai(AAI_BASE_URL, AAI_USER, AAI_PASSWORD, rest_no_auth, resource, "DELETE", data)
+ ret = call_aai(resource, "DELETE")
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise NFLCMException("Ns instance delete exception in AAI")
return json.JSONDecoder().decode(ret[1])
+
def query_ns(global_customer_id, service_type, service_instance_id, data):
resource = "/business/customers/customer/%s/service-subscriptions/service-subscription/" \
"%s/service-instances/service-instance/%s" % \
(global_customer_id, service_type, service_instance_id)
ret = call_aai(resource, "GET", data)
- # ret = call_req_aai(AAI_BASE_URL, AAI_USER, AAI_PASSWORD, rest_no_auth, resource, "GET", data)
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise NFLCMException("Ns instance query exception in AAI")
@@ -60,25 +61,24 @@ def query_ns(global_customer_id, service_type, service_instance_id, data):
def create_vnf(vnf_id, data):
resource = "/network/generic-vnfs/generic-vnf/%s" % vnf_id
ret = call_aai(resource, "PUT", data)
- # ret = call_req_aai(AAI_BASE_URL, AAI_USER, AAI_PASSWORD, rest_no_auth, resource, "PUT", data)
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise NFLCMException("Vnf instance creation exception in AAI")
return json.JSONDecoder().decode(ret[1])
-def delete_vnf(vnf_id, data=[]):
+
+def delete_vnf(vnf_id):
resource = "/network/generic-vnfs/generic-vnf/%s" % vnf_id
- ret = call_aai(resource, "DELETE", data)
- # ret = call_req_aai(AAI_BASE_URL, AAI_USER, AAI_PASSWORD, rest_no_auth, resource, "DELETE", data)
+ ret = call_aai(resource, "DELETE")
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise NFLCMException("Vnf instance delete exception in AAI")
return json.JSONDecoder().decode(ret[1])
+
def query_vnf(vnf_id, data):
resource = "/network/generic-vnfs/generic-vnf/%s" % vnf_id
ret = call_aai(resource, "GET", data)
- # ret = call_req_aai(AAI_BASE_URL, AAI_USER, AAI_PASSWORD, rest_no_auth, resource, "GET", data)
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise NFLCMException("Vnf instance query exception in AAI")
@@ -90,29 +90,28 @@ def create_vserver(cloud_owner, cloud_region_id, tenant_id, vserver_id, data):
"%s/tenants/tenant/%s/vservers/vserver/%s" % \
(cloud_owner, cloud_region_id, tenant_id, vserver_id)
ret = call_aai(resource, "PUT", data)
- # ret = call_req_aai(AAI_BASE_URL, AAI_USER, AAI_PASSWORD, rest_no_auth, resource, "PUT", data)
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise NFLCMException("Vserver creation exception in AAI")
return json.JSONDecoder().decode(ret[1])
-def delete_vserver(cloud_owner, cloud_region_id, tenant_id, vserver_id, data):
+
+def delete_vserver(cloud_owner, cloud_region_id, tenant_id, vserver_id):
resource = "/cloud-infrastructure/cloud-regions/cloud-region/%s/" \
"%s/tenants/tenant/%s/vservers/vserver/%s" % \
(cloud_owner, cloud_region_id, tenant_id, vserver_id)
- ret = call_aai(resource, "DELETE", data)
- # ret = call_req_aai(AAI_BASE_URL, AAI_USER, AAI_PASSWORD, rest_no_auth, resource, "DELETE", data)
+ ret = call_aai(resource, "DELETE")
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise NFLCMException("Vserver delete exception in AAI")
return json.JSONDecoder().decode(ret[1])
+
def query_vserver(cloud_owner, cloud_region_id, tenant_id, vserver_id, data):
resource = "/cloud-infrastructure/cloud-regions/cloud-region/%s/" \
"%s/tenants/tenant/%s/vservers/vserver/%s" % \
(cloud_owner, cloud_region_id, tenant_id, vserver_id)
ret = call_aai(resource, "GET", data)
- # ret = call_req_aai(AAI_BASE_URL, AAI_USER, AAI_PASSWORD, rest_no_auth, resource, "GET", data)
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise NFLCMException("Vserver query exception in AAI")
@@ -124,18 +123,17 @@ def put_vserver_relationship(cloud_owner, cloud_region_id, tenant_id, vserver_id
"%s/tenants/tenant/%s/vservers/vserver/%s/relationship-list/relationship" % \
(cloud_owner, cloud_region_id, tenant_id, vserver_id)
ret = call_aai(resource, "PUT", data)
- # ret = call_req_aai(AAI_BASE_URL, AAI_USER, AAI_PASSWORD, rest_no_auth, resource, "PUT", data)
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise NFLCMException("Put or update vserver relationship exception in AAI")
return json.JSONDecoder().decode(ret[1])
-def delete_vserver_relationship(cloud_owner, cloud_region_id, tenant_id, vserver_id, data):
+
+def delete_vserver_relationship(cloud_owner, cloud_region_id, tenant_id, vserver_id):
resource = "/cloud-infrastructure/cloud-regions/cloud-region/%s/" \
"%s/tenants/tenant/%s/vservers/vserver/%s/relationship-list/relationship" % \
(cloud_owner, cloud_region_id, tenant_id, vserver_id)
- ret = call_aai(resource, "DELETE", data)
- # ret = call_req_aai(AAI_BASE_URL, AAI_USER, AAI_PASSWORD, rest_no_auth, resource, "DELETE", data)
+ ret = call_aai(resource, "DELETE")
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise NFLCMException("Delete vserver relationship exception in AAI")
@@ -145,16 +143,15 @@ def delete_vserver_relationship(cloud_owner, cloud_region_id, tenant_id, vserver
def put_vnf_relationship(vnf_id, data):
resource = "/network/generic-vnfs/generic-vnf/%s/relationship-list/relationship" % vnf_id
ret = call_aai(resource, "PUT", data)
- # ret = call_req_aai(AAI_BASE_URL, AAI_USER, AAI_PASSWORD, rest_no_auth, resource, "PUT", data)
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise NFLCMException("Put or update vnf instance relationship exception in AAI")
return json.JSONDecoder().decode(ret[1])
-def delete_vnf_relationship(vnf_id, data):
+
+def delete_vnf_relationship(vnf_id):
resource = "/network/generic-vnfs/generic-vnf/%s/relationship-list/relationship" % vnf_id
- ret = call_aai(resource, "DELETE", data)
- # ret = call_req_aai(AAI_BASE_URL, AAI_USER, AAI_PASSWORD, rest_no_auth, resource, "DELETE", data)
+ ret = call_aai(resource, "DELETE")
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise NFLCMException("Delete vnf instance relationship exception in AAI")
@@ -166,18 +163,17 @@ def put_ns_relationship(global_customer_id, service_type, service_instance_id, d
"%s/service-instances/service-instance/%s/relationship-list/relationship" % \
(global_customer_id, service_type, service_instance_id)
ret = call_aai(resource, "PUT", data)
- # ret = call_req_aai(AAI_BASE_URL, AAI_USER, AAI_PASSWORD, rest_no_auth, resource, "PUT", data)
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise NFLCMException("Put or update ns instance relationship exception in AAI")
return json.JSONDecoder().decode(ret[1])
-def delete_ns_relationship(global_customer_id, service_type, service_instance_id, data):
+
+def delete_ns_relationship(global_customer_id, service_type, service_instance_id):
resource = "/business/customers/customer/%s/service-subscriptions/service-subscription/" \
"%s/service-instances/service-instance/%s/relationship-list/relationship" % \
(global_customer_id, service_type, service_instance_id)
- ret = call_aai(resource, "DELETE", data)
- # ret = call_req_aai(AAI_BASE_URL, AAI_USER, AAI_PASSWORD, rest_no_auth, resource, "DELETE", data)
+ ret = call_aai(resource, "DELETE")
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise NFLCMException("Delete ns instance relationship exception in AAI")
diff --git a/lcm/lcm/pub/config/config.py b/lcm/lcm/pub/config/config.py
index 492595df..650d6755 100644
--- a/lcm/lcm/pub/config/config.py
+++ b/lcm/lcm/pub/config/config.py
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
import os
# [MSB]
diff --git a/lcm/lcm/pub/database/models.py b/lcm/lcm/pub/database/models.py
index 826ba748..e46f7af9 100644
--- a/lcm/lcm/pub/database/models.py
+++ b/lcm/lcm/pub/database/models.py
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
from django.db import models
diff --git a/lcm/lcm/pub/exceptions.py b/lcm/lcm/pub/exceptions.py
index ac7b0c6d..274c0d06 100644
--- a/lcm/lcm/pub/exceptions.py
+++ b/lcm/lcm/pub/exceptions.py
@@ -14,4 +14,4 @@
class NFLCMException(Exception):
- pass \ No newline at end of file
+ pass
diff --git a/lcm/lcm/pub/msapi/gvnfmdriver.py b/lcm/lcm/pub/msapi/gvnfmdriver.py
index a09cb2a0..8449f6d3 100644
--- a/lcm/lcm/pub/msapi/gvnfmdriver.py
+++ b/lcm/lcm/pub/msapi/gvnfmdriver.py
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
import json
import logging
diff --git a/lcm/lcm/pub/utils/restcall.py b/lcm/lcm/pub/utils/restcall.py
index c13d07a6..89c4d224 100644
--- a/lcm/lcm/pub/utils/restcall.py
+++ b/lcm/lcm/pub/utils/restcall.py
@@ -141,4 +141,4 @@ def call_req_aai(base_url, user, passwd, auth_type, resource, method, content=''
ret = [4, str(sys.exc_info()), resp_status]
logger.debug("[%s]ret=%s" % (callid, str(ret)))
- return ret \ No newline at end of file
+ return ret
diff --git a/lcm/lcm/pub/utils/toscautil_new.py b/lcm/lcm/pub/utils/toscautil_new.py
index 90ce5fef..279fb09b 100644
--- a/lcm/lcm/pub/utils/toscautil_new.py
+++ b/lcm/lcm/pub/utils/toscautil_new.py
@@ -1450,7 +1450,3 @@ if __name__ == '__main__':
}
})
print convert_vnfd_model(src_json)
-
-
-
-
diff --git a/lcm/lcm/pub/utils/values.py b/lcm/lcm/pub/utils/values.py
index 4b7855c0..00cf5899 100644
--- a/lcm/lcm/pub/utils/values.py
+++ b/lcm/lcm/pub/utils/values.py
@@ -33,4 +33,4 @@ def get_boolean(val, def_val=0):
return 1 if val else 0
def get_integer(val, def_val=0):
- return val if val else 0 \ No newline at end of file
+ return val if val else 0
diff --git a/lcm/lcm/samples/resources.py b/lcm/lcm/samples/resources.py
index c873b117..2a4fa4ec 100644
--- a/lcm/lcm/samples/resources.py
+++ b/lcm/lcm/samples/resources.py
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
import json
import logging
import threading
diff --git a/lcm/lcm/settings.py b/lcm/lcm/settings.py
index 631ada8b..5583c4cd 100644
--- a/lcm/lcm/settings.py
+++ b/lcm/lcm/settings.py
@@ -129,6 +129,7 @@ LOGGING = {
if 'test' in sys.argv:
from lcm.pub.config import config
config.REG_TO_MSB_WHEN_START = False
+
DATABASES = {}
DATABASES['default'] = {
'ENGINE': 'django.db.backends.sqlite3',
diff --git a/lcm/run.sh b/lcm/run.sh
index eb8a6f46..dbe11e95 100755
--- a/lcm/run.sh
+++ b/lcm/run.sh
@@ -12,4 +12,5 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
nohup python manage.py runserver 127.0.0.1:8801 > /dev/null &
diff --git a/lcm/stop.sh b/lcm/stop.sh
index 6f9ff21f..db87c64d 100755
--- a/lcm/stop.sh
+++ b/lcm/stop.sh
@@ -12,4 +12,5 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
ps auxww | grep 'manage.py runserver 127.0.0.1:8801' | awk '{print $2}' | xargs kill -9
diff --git a/lcm/version.properties b/lcm/version.properties
index 7f86aa15..d7c69cd5 100644
--- a/lcm/version.properties
+++ b/lcm/version.properties
@@ -1,3 +1,18 @@
+#!/bin/bash
+# Copyright 2017 ZTE Corporation.
+#
+# 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.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
# Versioning variables
# Note that these variables cannot be structured (e.g. : version.release or version.snapshot etc... )
# because they are used in Jenkins, whose plug-in doesn't support