(bug 589) add proper filtering VDU by instance-id on scalling 61/6961/2
authortierno <alfonso.tiernosepulveda@telefonica.com>
Mon, 26 Nov 2018 09:28:58 +0000 (09:28 +0000)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Mon, 26 Nov 2018 11:13:41 +0000 (13:13 +0200)
Change-Id: Iaf4c38d6907a4af5124c85d94518004851b5f6c5
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
openmanod
osm_ro/nfvo.py

index 32c60ee..8dcb0f3 100755 (executable)
--- a/openmanod
+++ b/openmanod
@@ -48,7 +48,7 @@ import osm_ro
 
 __author__ = "Alfonso Tierno, Gerardo Garcia, Pablo Montes"
 __date__ = "$26-aug-2014 11:09:29$"
-__version__ = "0.5.82-r592"
+__version__ = "0.5.83-r593"
 version_date = "Nov 2018"
 database_version = 33      # expected database schema version
 
index f8aa47e..01ac017 100644 (file)
@@ -4374,13 +4374,14 @@ def instance_action(mydb,nfvo_tenant,instance_id, action_dict):
                     raise NfvoException("Cannot find the vdu with id {}".format(vdu_id), HTTP_Not_Found)
             else:
                 if not osm_vdu_id and not member_vnf_index:
-                    raise NfvoException("Invalid imput vdu parameters. Must supply either 'vdu-id' of 'osm_vdu_id','member-vnf-index'")
+                    raise NfvoException("Invalid input vdu parameters. Must supply either 'vdu-id' of 'osm_vdu_id','member-vnf-index'")
                 target_vms = mydb.get_rows(
                     # SELECT=("ivms.uuid", "ivnfs.datacenter_id", "ivnfs.datacenter_tenant_id"),
                     FROM="instance_vms as ivms join instance_vnfs as ivnfs on ivms.instance_vnf_id=ivnfs.uuid"\
                          " join sce_vnfs as svnfs on ivnfs.sce_vnf_id=svnfs.uuid"\
                          " join vms on ivms.vm_id=vms.uuid",
-                    WHERE={"vms.osm_id": osm_vdu_id, "svnfs.member_vnf_index": member_vnf_index},
+                    WHERE={"vms.osm_id": osm_vdu_id, "svnfs.member_vnf_index": member_vnf_index,
+                           "ivnfs.instance_scenario_id": instance_id},
                     ORDER_BY="ivms.created_at"
                 )
                 if not target_vms: