From d4fc1d77a4b7c668453042b83e34da76ee3c3818 Mon Sep 17 00:00:00 2001 From: Yuriy Taraday Date: Fri, 24 Jun 2011 09:54:38 +0400 Subject: Unwind last commit, force anyjson to use our serialization methods. --- bin/nova-manage | 8 ++++---- nova/compute/api.py | 1 + nova/db/sqlalchemy/api.py | 15 +++------------ nova/utils.py | 9 +++++++++ 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index 0147ae21b..e09ea495d 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -874,10 +874,10 @@ class InstanceTypeCommands(object): try: instance_types.create(name, memory, vcpus, local_gb, flavorid, swap, rxtx_quota, rxtx_cap) - except exception.InvalidInputException: - print "Must supply valid parameters to create instance_type" - print e - sys.exit(1) + #except exception.InvalidInputException: + # print "Must supply valid parameters to create instance_type" + # print e + # sys.exit(1) except exception.ApiError, e: print "\n\n" print "\n%s" % e diff --git a/nova/compute/api.py b/nova/compute/api.py index f1c31a092..9a77a2aa2 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -291,6 +291,7 @@ class API(base.Base): 'blob': zone_blob, 'num_instances': num_instances, } + LOG.debug(request_spec) rpc.cast(context, FLAGS.scheduler_topic, diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index 5dc2b9e7a..7119f43eb 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -2510,10 +2510,7 @@ def instance_type_get_by_id(context, id): if not inst_type: raise exception.InstanceTypeNotFound(instance_type=id) else: - res = dict(inst_type) - for field in ['created_at', 'updated_at', 'deleted_at']: - res.pop(field, None) - return res + return dict(inst_type) @require_context @@ -2526,10 +2523,7 @@ def instance_type_get_by_name(context, name): if not inst_type: raise exception.InstanceTypeNotFoundByName(instance_type_name=name) else: - res = dict(inst_type) - for field in ['created_at', 'updated_at', 'deleted_at']: - res.pop(field, None) - return res + return dict(inst_type) @require_context @@ -2542,10 +2536,7 @@ def instance_type_get_by_flavor_id(context, id): if not inst_type: raise exception.FlavorNotFound(flavor_id=id) else: - res = dict(inst_type) - for field in ['created_at', 'updated_at', 'deleted_at']: - res.pop(field, None) - return res + return dict(inst_type) @require_admin_context diff --git a/nova/utils.py b/nova/utils.py index 691134ada..a77cf7993 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -525,6 +525,15 @@ def loads(s): return json.loads(s) +try: + import anyjson +except ImportError: + pass +else: + anyjson._modules.append(("nova.utils", "dumps", TypeError, "loads", ValueError)) + anyjson.force_implementation("nova.utils") + + _semaphores = {} -- cgit