diff options
author | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-09-02 10:33:19 +0800 |
---|---|---|
committer | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-09-02 10:36:43 +0800 |
commit | e4f53709988ef82a4afbb53bc34200755eb4a33b (patch) | |
tree | 9a8213ac2c71fb654c1d9f8ae818ed291345be2b | |
parent | f2580f8d27468047c199f921728548e815a89d94 (diff) |
Refactor vfc vnflcm code format
Change-Id: Iae1a037ef19870c1afadb9a46cf8bd0848c07394
Issue-Id: VFC-237
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r-- | lcm/lcm/nf/__init__.py | 2 | ||||
-rw-r--r-- | lcm/lcm/nf/vnfs/const.py | 29 | ||||
-rw-r--r-- | lcm/lcm/nf/vnfs/swagger.json | 2 | ||||
-rw-r--r-- | lcm/lcm/nf/vnfs/tests/__init__.py | 2 | ||||
-rw-r--r-- | lcm/lcm/nf/vnfs/tests/test_vnf_cancel.py | 27 | ||||
-rw-r--r-- | lcm/lcm/nf/vnfs/tests/test_vnf_create.py | 1 | ||||
-rw-r--r-- | lcm/lcm/nf/vnfs/tests/test_vnf_query.py | 1 | ||||
-rw-r--r-- | lcm/lcm/nf/vnfs/views.py | 1 | ||||
-rw-r--r-- | lcm/lcm/nf/vnfs/vnf_cancel/__init__.py | 2 | ||||
-rw-r--r-- | lcm/lcm/nf/vnfs/vnf_cancel/delete_vnf_identifier.py | 1 | ||||
-rw-r--r-- | lcm/lcm/nf/vnfs/vnf_cancel/term_vnf.py | 1 | ||||
-rw-r--r-- | lcm/lcm/nf/vnfs/vnf_create/create_vnf_identifier.py | 1 | ||||
-rw-r--r-- | lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py | 1 | ||||
-rw-r--r-- | lcm/lcm/pub/aaiapi/aai.py | 1 | ||||
-rw-r--r-- | lcm/lcm/pub/exceptions.py | 2 | ||||
-rw-r--r-- | lcm/lcm/settings.py | 1 |
16 files changed, 53 insertions, 22 deletions
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..632e4f37 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
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/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', |