Read tag name instead of ID

Current version of db load_metadefs looks for tag id instead
of tag name. In result user needs to provide additional
unnecessary tag ID in .json file and also it may lead to
conflicts in DB and unhandled exceptions. This change fixes
this issue.

Change-Id: Ie0192f87dce120221d09dba49d2eb33094464cef
Closes-Bug: 1445026
This commit is contained in:
Pawel Koniszewski 2015-04-16 03:21:20 -04:00
parent 00d84d1a27
commit 2b556b2f8d
1 changed files with 1 additions and 1 deletions

View File

@ -327,7 +327,7 @@ def _populate_metadata(meta, metadata_path=None, merge=False,
'name': tag.get('name'),
'namespace_id': namespace_id,
}
tag_id = _get_resource_id(tags_table, namespace_id, tag['id'])
tag_id = _get_resource_id(tags_table, namespace_id, tag['name'])
if not tag_id:
values.update({'created_at': timeutils.utcnow()})
_insert_data_to_db(tags_table, values)