Skip to content

Commit

Permalink
Add check for object type before returning the list
Browse files Browse the repository at this point in the history
Change-Id: I8371cbd481e4a11f8613488fa703d84070b87fb2
Closes-Bug: 1575473
  • Loading branch information
Sachin Bansal committed May 3, 2016
1 parent 2b91358 commit 313777c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/config/api-server/vnc_cfg_types.py
Expand Up @@ -1193,7 +1193,8 @@ def pre_dbe_update(cls, id, fq_name, obj_dict, db_conn, **kwargs):
def pre_dbe_delete(cls, id, obj_dict, db_conn):
vdns_name = ":".join(obj_dict['fq_name'])
if 'parent_uuid' in obj_dict:
ok, read_result = cls.dbe_read(db_conn, 'domain', id)
ok, read_result = cls.dbe_read(db_conn, 'domain',
obj_dict['parent_uuid'])
if not ok:
return ok, read_result
virtual_DNSs = read_result.get('virtual_DNSs', [])
Expand Down
4 changes: 4 additions & 0 deletions src/config/common/vnc_cassandra.py
Expand Up @@ -534,6 +534,8 @@ def object_read(self, res_type, obj_uuids, field_names=None):
for row_key in obj_rows:
obj_uuid = row_key
obj_cols = obj_rows[obj_uuid]
if obj_type != json.loads(obj_cols['type'][0]):
continue
result = {}
result['uuid'] = obj_uuid
result['fq_name'] = json.loads(obj_cols['fq_name'][0])
Expand Down Expand Up @@ -816,6 +818,8 @@ def get_fq_name_uuid_list(obj_uuids):
ret_list = []
for obj_uuid in obj_uuids:
try:
if obj_type != self.uuid_to_obj_type(obj_uuid):
continue
obj_fq_name = self.uuid_to_fq_name(obj_uuid)
ret_list.append((obj_fq_name, obj_uuid))
except NoIdError:
Expand Down

0 comments on commit 313777c

Please sign in to comment.