Add suboperation to lcm op occ 68/86468/2
authorfujinhua <fu.jinhua@zte.com.cn>
Sun, 28 Apr 2019 07:44:40 +0000 (15:44 +0800)
committerfujinhua <fu.jinhua@zte.com.cn>
Sun, 28 Apr 2019 07:58:10 +0000 (15:58 +0800)
Change-Id: Idba4b5374f564d467694e7592d287ace868346a5
Issue-ID: VFC-1306
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
lcm/lcm/nf/biz/operate_vnf_lcm_op_occ.py
lcm/lcm/pub/database/migrations/0002_vnflcmopoccmodel_sub_operation.py [new file with mode: 0644]
lcm/lcm/pub/database/models.py

index b8e7f50..919a346 100644 (file)
@@ -77,11 +77,13 @@ class VnfLcmOpOcc:
                              }
                          })).save()
 
-    def upd(self, operation_state=None, error=None):
+    def upd(self, operation_state=None, sub_operation=None, error=None):
         occ = VNFLcmOpOccModel.objects.filter(id=self.lcm_op_id)
         with MUTEX_UPD_OCC:
             if operation_state:
                 occ.update(operation_state=operation_state)
+            if sub_operation:
+                occ.update(sub_operation=sub_operation)
             if error:
                 occ.update(error=json.dumps(error))
 
diff --git a/lcm/lcm/pub/database/migrations/0002_vnflcmopoccmodel_sub_operation.py b/lcm/lcm/pub/database/migrations/0002_vnflcmopoccmodel_sub_operation.py
new file mode 100644 (file)
index 0000000..d0be41c
--- /dev/null
@@ -0,0 +1,32 @@
+# Copyright 2019 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.
+# Generated by Django 1.11.9 on 2019-04-28 07:45
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('database', '0001_initial'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='vnflcmopoccmodel',
+            name='sub_operation',
+            field=models.CharField(db_column=b'SUBOPERATION', max_length=30, null=True),
+        ),
+    ]
index 3ac4a83..c2e0071 100644 (file)
@@ -326,6 +326,7 @@ class VNFLcmOpOccModel(models.Model):
     vnf_instance_id = models.CharField(db_column='VNFINSTANCEID', null=False, max_length=255)
     grant_id = models.CharField(db_column='GRANTID', null=True, max_length=255)
     operation = models.CharField(db_column='OPERATION', null=False, max_length=30)
+    sub_operation = models.CharField(db_column='SUBOPERATION', null=True, max_length=30)
     is_automatic_invocation = models.CharField(db_column='ISAUTOMATICINVOCATION', null=False, max_length=5)
     operation_params = models.TextField(db_column='OPERATIONPARAMS', null=False)
     is_cancel_pending = models.CharField(db_column='ISCANCELPENDING', null=False, max_length=5)