summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2018-03-19 17:17:26 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2018-03-19 17:26:46 +0800
commit405ab3bc5b7161a2616501710bad23caeea669e2 (patch)
treee9361931981d4ba3190707e30ce4afbb8bc8bfcf
parenta0b2caa54c7d94664d33c83d360f144e4bc966eb (diff)
Fix vfc-vnflcm query vnfd bug
Change-Id: I0512dd92cec1a3b6878514d1b3add3ffc89267dc Issue-ID: VFC-824 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r--lcm/lcm/nf/const.py20
-rw-r--r--lcm/lcm/nf/vnf_create/inst_vnf.py4
2 files changed, 22 insertions, 2 deletions
diff --git a/lcm/lcm/nf/const.py b/lcm/lcm/nf/const.py
index da338f67..8b0c0bdb 100644
--- a/lcm/lcm/nf/const.py
+++ b/lcm/lcm/nf/const.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
from lcm.pub.utils.jobutil import enum
@@ -21,6 +22,7 @@ VNF_STATUS = enum(NULL='null', INSTANTIATING="instantiating", INACTIVE='inactive
inst_req_data = {
"flavourId": "flavour_1",
"instantiationLevelId": "instantiationLevel_1",
+ "vnfmId": "vnfm_1",
"extVirtualLinks": [
{
"vlInstanceId": "1",
@@ -72,6 +74,7 @@ inst_req_data = {
],
"localizationLanguage": "en_US",
"additionalParams": {
+ "vimId": "vim_1",
"inputs": {
"key1": "test1",
"key2": "test2"
@@ -568,7 +571,7 @@ c10_data_get_vm = {
"status": "ACTIVE"
}
-vnfpackage_info = {
+vnfdModel = {
"volume_storages": [],
"inputs": {
"pe1_id": {
@@ -654,6 +657,21 @@ vnfpackage_info = {
}
}
+vnfpackage_info = {
+ "imageInfo": [],
+ "csarId": "vOpenNAT",
+ "packageInfo": {
+ "csarName": "vOpenNAT.csar",
+ "vnfdModel": json.dumps(vnfdModel),
+ "vnfdProvider": "Intel",
+ "vnfdId": "openNAT_1.0",
+ "downloadUrl": "http://10.96.33.39:8806/static/catalog/vOpenNAT/vOpenNAT.csar",
+ "vnfVersion": "v1.0",
+ "vnfdVersion": "v1.0",
+ "vnfPackageId": "vOpenNAT"
+ }
+}
+
# # vnfd_rawdata
# vnfd_rawdata = {
# "rawData": {
diff --git a/lcm/lcm/nf/vnf_create/inst_vnf.py b/lcm/lcm/nf/vnf_create/inst_vnf.py
index 59ec9930..5eb4f01e 100644
--- a/lcm/lcm/nf/vnf_create/inst_vnf.py
+++ b/lcm/lcm/nf/vnf_create/inst_vnf.py
@@ -170,7 +170,9 @@ class InstVnf(Thread):
def create_res(self):
logger.info("[NF instantiation] create resource start")
- adaptor.create_vim_res(self.vnfd_info, self.do_notify)
+ self.vnfdModel = json.loads(ignore_case_get(ignore_case_get(self.vnfd_info, "packageInfo"), "vnfdModel"))
+ logger.debug("self.vnfdModel = %s", self.vnfdModel)
+ adaptor.create_vim_res(self.vnfdModel, self.do_notify)
JobUtil.add_job_status(self.job_id, 70, '[NF instantiation] create resource finish')
logger.info("[NF instantiation] create resource finish")