From 0e2b3e932d3e5fe00fed1da95e55808391d4832e Mon Sep 17 00:00:00 2001 From: Yuriy Taraday Date: Tue, 21 Jun 2011 16:55:45 +0400 Subject: Filter out datetime fields from instance_type --- nova/db/sqlalchemy/api.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index 7119f43eb..5dc2b9e7a 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -2510,7 +2510,10 @@ def instance_type_get_by_id(context, id): if not inst_type: raise exception.InstanceTypeNotFound(instance_type=id) else: - return dict(inst_type) + res = dict(inst_type) + for field in ['created_at', 'updated_at', 'deleted_at']: + res.pop(field, None) + return res @require_context @@ -2523,7 +2526,10 @@ def instance_type_get_by_name(context, name): if not inst_type: raise exception.InstanceTypeNotFoundByName(instance_type_name=name) else: - return dict(inst_type) + res = dict(inst_type) + for field in ['created_at', 'updated_at', 'deleted_at']: + res.pop(field, None) + return res @require_context @@ -2536,7 +2542,10 @@ def instance_type_get_by_flavor_id(context, id): if not inst_type: raise exception.FlavorNotFound(flavor_id=id) else: - return dict(inst_type) + res = dict(inst_type) + for field in ['created_at', 'updated_at', 'deleted_at']: + res.pop(field, None) + return res @require_admin_context -- cgit