Fix bug 1449: Preexisting flavor deleted 84/10384/3
authorlloretgalleg <illoret@indra.es>
Wed, 24 Feb 2021 12:06:57 +0000 (12:06 +0000)
committersousaedu <eduardo.sousa@canonical.com>
Wed, 24 Feb 2021 14:36:59 +0000 (15:36 +0100)
Change-Id: I98283117f99e8d9e3d795961654b603c644d9d48
Signed-off-by: lloretgalleg <illoret@indra.es>
RO/osm_ro/nfvo.py

index a7b15a2..a617709 100644 (file)
@@ -1801,7 +1801,9 @@ def delete_vnf(mydb,tenant_id,vnf_id,datacenter=None,vim_tenant=None):
             #delelte at VIM
             c = mydb.get_rows(FROM='datacenters_flavors', WHERE={'flavor_id': flavor})
             for flavor_vim in c:
-                if not flavor_vim['created']:  # skip this flavor because not created by openmano
+                # skip this flavor because not created by openmano
+                # field created in the database is a string, must do a string comparison
+                if flavor_vim['created'] != "true":
                     continue
                 # look for vim
                 myvim = None