summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lcm/lcm/nf/vnf_create/create_vnf_identifier.py9
-rw-r--r--lcm/lcm/nf/vnf_create/inst_vnf.py9
2 files changed, 9 insertions, 9 deletions
diff --git a/lcm/lcm/nf/vnf_create/create_vnf_identifier.py b/lcm/lcm/nf/vnf_create/create_vnf_identifier.py
index d85a228b..5f5dedab 100644
--- a/lcm/lcm/nf/vnf_create/create_vnf_identifier.py
+++ b/lcm/lcm/nf/vnf_create/create_vnf_identifier.py
@@ -11,7 +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
import uuid
@@ -83,10 +83,11 @@ class CreateVnf:
logger.debug("check_valid::is_exist=%s" % is_exist)
if is_exist:
raise NFLCMException('VNF is already exist.')
- self.vnfdModel = query_vnfpackage_by_id(self.csar_id)
+ vnf_package_info = query_vnfpackage_by_id(self.csar_id)
+ self.vnfd_info = json.loads(ignore_case_get(ignore_case_get(vnf_package_info, "packageInfo"), "vnfdModel"))
def save_db(self):
- metadata = ignore_case_get(self.vnfdModel, "metadata")
+ metadata = ignore_case_get(self.vnfd_info, "metadata")
version = ignore_case_get(metadata, "vnfdVersion")
vendor = ignore_case_get(metadata, "vendor")
netype = ignore_case_get(metadata, "type")
@@ -97,7 +98,7 @@ class CreateVnf:
version=version,
vendor=vendor,
netype=netype,
- vnfd_model=self.vnfdModel,
+ vnfd_model=self.vnfd_info,
status='NOT_INSTANTIATED',
nf_desc=self.description,
vnfdid=self.vnfd_id,
diff --git a/lcm/lcm/nf/vnf_create/inst_vnf.py b/lcm/lcm/nf/vnf_create/inst_vnf.py
index f9d0c06a..09cf506d 100644
--- a/lcm/lcm/nf/vnf_create/inst_vnf.py
+++ b/lcm/lcm/nf/vnf_create/inst_vnf.py
@@ -76,7 +76,8 @@ class InstVnf(Thread):
inputs = json.loads(inputs)
for key, val in inputs.items():
input_parameters.append({"key": key, "value": val})
- self.vnfd_info = query_vnfpackage_by_id(self.vnfd_id)
+ vnf_package_info = query_vnfpackage_by_id(self.vnfd_id)
+ self.vnfd_info = json.loads(ignore_case_get(ignore_case_get(vnf_package_info, "packageInfo"), "vnfdModel"))
# self.vnfd_info = vnfd_model_dict # just for test
self.update_cps()
@@ -172,10 +173,8 @@ class InstVnf(Thread):
def create_res(self):
logger.info("[NF instantiation] create resource start")
- 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)
-
+ logger.debug("self.vnfdModel = %s", self.vnfd_info)
+ adaptor.create_vim_res(self.vnfd_info, self.do_notify)
JobUtil.add_job_status(self.job_id, 70, '[NF instantiation] create resource finish')
logger.info("[NF instantiation] create resource finish")