db_export_metadefs generates inappropriate json files

Json files generated in metadata seeding using "glance-manage
db_export_metadefs" are inappropriate. Attribute 'owner' for namespace
is useless and shouldn't be generated.

Object related to resource_type_associations after exporting to json has
a not necessary (useless) attribute 'protected'. Database record in
metadef_namespace_resource_types doesn't have attribute 'proteced'.

Other issue related to this bug are 'prefix' and 'properties_target'
attributes. They should be generated for resource_type_associations
in json file but they aren't.

Change-Id: I1d5077485aa86cd63fed3aa852f633d5c95e89ad
Closes-Bug: #1377947
This commit is contained in:
Bartosz Fic 2014-10-09 17:50:36 +02:00 committed by Pawel Koniszewski
parent b6eb01a18f
commit 60a402e243
1 changed files with 3 additions and 2 deletions

View File

@ -283,7 +283,6 @@ def _export_data_to_file(meta, path):
'description': namespace['description'],
'visibility': namespace['visibility'],
'protected': namespace['protected'],
'owner': namespace['owner'],
'resource_type_associations': [],
'properties': {},
'objects': [],
@ -303,7 +302,9 @@ def _export_data_to_file(meta, path):
namespace_resource_type['resource_type_id'])
resource_types.append({
'name': resource_type['name'],
'protected': resource_type['protected']
'prefix': namespace_resource_type['prefix'],
'properties_target': namespace_resource_type[
'properties_target']
})
values.update({
'resource_type_associations': resource_types