summaryrefslogtreecommitdiffstats
path: root/lcm
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2019-04-25 10:19:18 +0800
committerfujinhua <fu.jinhua@zte.com.cn>2019-04-25 10:19:18 +0800
commitf70821304c49dd58e7a7eb791727acbec67fd018 (patch)
tree071a0d07102d55d1da43cd8dbc4e7666971af3da /lcm
parent2587821d200af282fa78f1f307aa4e0752f85321 (diff)
Add lcm op occ to scale to level
Change-Id: I184a0f9e5aaa877a84121c859ebad8ab01ad35ab Issue-ID: VFC-1306 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
Diffstat (limited to 'lcm')
-rw-r--r--lcm/lcm/nf/biz/scale_vnf.py3
-rw-r--r--lcm/lcm/nf/biz/scale_vnf_to_level.py10
2 files changed, 12 insertions, 1 deletions
diff --git a/lcm/lcm/nf/biz/scale_vnf.py b/lcm/lcm/nf/biz/scale_vnf.py
index 9f591931..60efb86c 100644
--- a/lcm/lcm/nf/biz/scale_vnf.py
+++ b/lcm/lcm/nf/biz/scale_vnf.py
@@ -53,6 +53,7 @@ class ScaleVnf(Thread):
operation=OPERATION_TYPE.SCALE,
task=OPERATION_TASK.SCALE
)
+ self.op_type = OPERATION_TYPE.SCALE
def run(self):
try:
@@ -155,7 +156,7 @@ class ScaleVnf(Thread):
def send_notification(self):
data = prepare_notification(nfinstid=self.nf_inst_id,
jobid=self.job_id,
- operation=OPERATION_TYPE.SCALE,
+ operation=self.op_type,
operation_state=OPERATION_STATE_TYPE.COMPLETED)
# TODO: need set changedExtConnectivity for data
diff --git a/lcm/lcm/nf/biz/scale_vnf_to_level.py b/lcm/lcm/nf/biz/scale_vnf_to_level.py
index 03189e9a..0e856ecd 100644
--- a/lcm/lcm/nf/biz/scale_vnf_to_level.py
+++ b/lcm/lcm/nf/biz/scale_vnf_to_level.py
@@ -16,8 +16,11 @@ import logging
from lcm.nf.biz.scale_vnf import ScaleVnf
from lcm.nf.const import GRANT_TYPE
+from lcm.nf.const import OPERATION_TYPE
+from lcm.nf.const import OPERATION_TASK
from lcm.pub.database.models import VmInstModel
from lcm.pub.exceptions import NFLCMException
+from .operate_vnf_lcm_op_occ import VnfLcmOpOcc
logger = logging.getLogger(__name__)
@@ -28,6 +31,13 @@ class ScaleVnfToLevel(ScaleVnf):
nf_inst_id=nf_inst_id,
job_id=job_id)
self.aspect_id = ''
+ self.lcm_op_occ = VnfLcmOpOcc(
+ vnf_inst_id=nf_inst_id,
+ lcm_op_id=job_id,
+ operation=OPERATION_TYPE.SCALE_TO_LEVEL,
+ task=OPERATION_TASK.SCALE_TO_LEVEL
+ )
+ self.op_type = OPERATION_TYPE.SCALE_TO_LEVEL
def scale_pre(self):
self.vnfd_info = json.loads(self.vnf_insts[0].vnfd_model)