summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshish Jain <ashish.jain14@wipro.com>2015-03-23 16:01:42 +0000
committerKamil Rykowski <kamil.rykowski@intel.com>2015-04-09 16:47:54 +0200
commitfe7ef09b3808509e010048184fa8d5acbf8312e5 (patch)
treeb1f9f1e52afe5bd3a9e4a3df82db60c278ec0c79
parentf84e49db5a455b36901b642125b5cf850f90c81d (diff)
downloadglance-fe7ef09b3808509e010048184fa8d5acbf8312e5.tar.gz
Fixes glance-manage exporting meta definitions issue
While using glance-manage db_export_metadefs the command fails with NoSuchColumnError for column 'name'. The issue is with calling function _export_data_to_file populating the values for resource_type_associations. This resource_type_associations expect one of the fields as 'name' whereas the function call _get_resource_type is returning an 'id'. Modified the _get_resource_type method to return whole resource type object. Change-Id: I1fb3f8eb60fec354d4897debd9034bf61d1a57b4 Closes-Bug: #1434237
-rwxr-xr-xglance/db/sqlalchemy/metadata.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/glance/db/sqlalchemy/metadata.py b/glance/db/sqlalchemy/metadata.py
index 1557168b4..aeebcc3e8 100755
--- a/glance/db/sqlalchemy/metadata.py
+++ b/glance/db/sqlalchemy/metadata.py
@@ -91,9 +91,8 @@ def _get_resource_type_id(meta, name):
def _get_resource_type(meta, resource_type_id):
rt_table = get_metadef_resource_types_table(meta)
return (
- select([rt_table.c.id]).
+ rt_table.select().
where(rt_table.c.id == resource_type_id).
- select_from(rt_table).
execute().fetchone())