[openstack-dev] [Grizzly] Retrieving a flavors extra-specs in horizon
Dale, StewartX T
stewartx.t.dale at intel.com
Fri Aug 2 01:50:48 UTC 2013
Switching to your mentioned function fixed my issues. Thanks!
From: Kieran Spear [mailto:kispear at gmail.com]
Sent: Thursday, August 01, 2013 5:30 PM
To: OpenStack Development Mailing List
Subject: Re: [openstack-dev] [Grizzly] Retrieving a flavors extra-specs in
On 2 August 2013 09:32, Dale, StewartX T <stewartx.t.dale at intel.com> wrote:
> Hi List,
> I'm trying to port some UI(horizon) customization I did in Folsom so
> that it works in Grizzly and I could use everyone's help. Must of the
> process has gone smoothly, just one piece that isn't working. It's the
> code that gets the extra-specs of a flavor. My old Folsom based code looks
> flavor = api.flavor_get(self.request, flavor_id)
> extras = flavor.get_keys()
> inst.flavor_id = flavor_id
> if extras:
> inst.myvalue = extras['mySpecs']
> inst.myvalue = "-"
> But using that code in Grizzly causes a crash ( and no log entries so
> I don't even know why, just the). I did some research and saw in the
> release notes of Grizzly that they had added support for getting a
> flavors extra specs in horizon
> cs_Support) but I can't find any actual examples of how to do it.
The flavor part of code above should work fine (assuming 'mySpecs' is
actually in the returned specs). But there's a flavor_get_extras function
you can use too:
>>> extras = api.nova.flavor_get_extras(self.request, flavor_id,
>>> raw=True) extras
>>> extras.get('test', '-')
>>> extras.get('mySpecs', '-')
Check out the admin flavors panel for other examples.
> I am hoping someone on the list might know.
> -Stewart Dale
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 7315 bytes
Desc: not available
More information about the OpenStack-dev