From 6ec0ac30c760328aa52474ad77d0ace40550e3d3 Mon Sep 17 00:00:00 2001 From: "J. Daniel Schmidt" Date: Fri, 30 Mar 2012 12:20:21 +0200 Subject: fixed postgresql flavor-create fixes bug 968190 nova flavor-create failed on postgresql DB because sqlalchemy tried to write an integer into a varchar field Change-Id: Ib47d8d10e96fedb2158f454503fe1ca3493c16bb Signed-Off-By: Bernhard M. Wiedemann --- Authors | 1 + nova/compute/instance_types.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Authors b/Authors index 25d31243f..82f5d5359 100644 --- a/Authors +++ b/Authors @@ -75,6 +75,7 @@ Hisaki Ohara Ilya Alekseyev Isaku Yamahata Ivan Kolodyazhny +J. Daniel Schmidt Jake Dahn James E. Blair Jason Cannavale diff --git a/nova/compute/instance_types.py b/nova/compute/instance_types.py index fa001f2cd..2bc470a41 100644 --- a/nova/compute/instance_types.py +++ b/nova/compute/instance_types.py @@ -66,7 +66,9 @@ def create(name, memory, vcpus, root_gb, ephemeral_gb, flavorid, swap=None, raise exception.InvalidInput(reason=msg) kwargs['name'] = name - kwargs['flavorid'] = flavorid + # NOTE(vish): Internally, flavorid is stored as a string but it comes + # in through json as an integer, so we convert it here. + kwargs['flavorid'] = unicode(flavorid) try: return db.instance_type_create(context.get_admin_context(), kwargs) -- cgit