Skip to content

Commit

Permalink
If 'uuid' key specified but None, do lookup from fq-name to uuid
Browse files Browse the repository at this point in the history
Change-Id: Iaf9543611d9241d37cb4d7c85530f049af1dd0d7
Closes-Bug: 1635728
(cherry picked from commit be9c3bd)
  • Loading branch information
Hampapur Ajay committed Dec 1, 2016
1 parent cd5ce30 commit 20d4282
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/config/api-server/vnc_cfg_types.py
Expand Up @@ -53,9 +53,8 @@ def get_quota_for_resource(cls, obj_type, obj_dict, db_conn):

if 'project_refs' in obj_dict:
proj_dict = obj_dict['project_refs'][0]
if 'uuid' in proj_dict:
proj_uuid = proj_dict['uuid']
else:
proj_uuid = proj_dict.get('uuid')
if not proj_uuid:
proj_uuid = db_conn.fq_name_to_uuid('project', proj_dict['to'])
elif 'parent_type' in obj_dict and obj_dict['parent_type'] == 'project':
proj_uuid = obj_dict['parent_uuid']
Expand Down Expand Up @@ -1105,9 +1104,8 @@ def undo_vn_id():
# subnet uuid for all cidrs in flat-ipam
for ipam in ipam_refs:
ipam_fq_name = ipam['to']
if 'uuid' in ipam:
ipam_uuid = ipam['uuid']
else:
ipam_uuid = ipam.get('uuid')
if not ipam_uuid:
ipam_uuid = db_conn.fq_name_to_uuid('network_ipam',
ipam_fq_name)
(ok, ipam_dict) = db_conn.dbe_read(
Expand Down

0 comments on commit 20d4282

Please sign in to comment.