fix in VIM openvim connector 75/8175/1
authortierno <alfonso.tiernosepulveda@telefonica.com>
Thu, 14 Nov 2019 14:06:31 +0000 (14:06 +0000)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Thu, 14 Nov 2019 14:09:26 +0000 (14:09 +0000)
Change-Id: I3f504273444b31e06094feceea9ef413a53c6db9
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
RO-VIM-openvim/osm_rovim_openvim/vimconn_openvim.py

index c89a303..86ee02f 100644 (file)
@@ -323,6 +323,7 @@ get_processor_rankings_response_schema = {
     }
 }
 
+
 class vimconnector(vimconn.vimconnector):
     def __init__(self, uuid, name, tenant_id, tenant_name, url, url_admin=None, user=None, passwd=None,
                  log_level="DEBUG", config={}, persistent_info={}):
@@ -391,13 +392,16 @@ class vimconnector(vimconn.vimconnector):
                 a= self._remove_extra_items(d, schema['items'])
                 if a is not None: deleted.append(a)
         elif type(data) is dict:
+            to_delete = []
             for k in data.keys():
                 if 'properties' not in schema or k not in schema['properties'].keys():
-                    del data[k]
+                    to_delete.append(k)
                     deleted.append(k)
                 else:
                     a = self._remove_extra_items(data[k], schema['properties'][k])
                     if a is not None:  deleted.append({k:a})
+            for k in to_delete:
+                del data[k]
         if len(deleted) == 0: return None
         elif len(deleted) == 1: return deleted[0]
         else: return deleted