[openstack-dev] horizon - extra-specs questionS

Matt Joyce matt.joyce at cloudscaling.com
Tue Sep 4 23:26:13 UTC 2012


Maybe I misunderstood.

I was assuming your question was specific to whether or not putting a table
inside the instance creation workflow makes sense.

If it's a generic question about coding practice... I'd say blueprint?  But
I could totally be out of my mind in thinking that.

I think as far as getting it into folsom odds are the feature freeze will
jump in the way.

Personally I like it.

-Matt

On Tue, Sep 4, 2012 at 4:16 PM, Bhandaru, Malini K <
malini.k.bhandaru at intel.com> wrote:

>  Matt, new to all things Open Stack. I thought blueprints were to define
> a feature and get approval.****
>
> Extra specs for flavors is all approved.  Yours truly just struggling to
> build in the UI support!****
>
> ** **
>
> Extra specs is associated with a flavor is we have a hierarchy. ****
>
> ** **
>
> ** **
>
> *From:* Matt Joyce [mailto:matt.joyce at cloudscaling.com]
> *Sent:* Tuesday, September 04, 2012 4:04 PM
> *To:* OpenStack Development Mailing List
> *Subject:* Re: [openstack-dev] horizon - extra-specs questionS****
>
> ** **
>
> Maybe this is better done as a blueprint in launchpad?****
>
> On Tue, Sep 4, 2012 at 3:48 PM, Bhandaru, Malini K <
> malini.k.bhandaru at intel.com> wrote:****
>
> Greetings All!****
>
>  ****
>
> Would like to via the flavor-edit menu make extra specs view-able and
> editable. ****
>
>  ****
>
> Is it possible in a view to support rendering a table in addition to
> ordinary fields?****
>
> The ordinary fields being VCPUs, RAM etc and the table being extra_specs?*
> ***
>
> I also need the create_extra_specs and edit_extra_specs to carry over the
> flavor_id in their url****
>
> Alternately if there is a similar example you could point me too…****
>
>  ****
>
> And before I can debug the above I run in a javascrip error on clicking my
> edit-flavor button.****
>
>  ****
>
>  ****
>
> Any and all help appreciated!****
>
> Regards****
>
> Malini ****
>
>  ****
>
>  ****
>
>  ****
>
> In views.py****
>
>  ****
>
> from .extra_specs.tables import ExtraSpecsTable****
>
> ..****
>
> ..****
>
>  ****
>
> def get_extra_spec_data(request, flavor_id):****
>
>         extra_spec_list = []****
>
>         try:****
>
>             extra_spec_dict = api.extra_spec_list(request, flavor_id)****
>
>             for k in extra_spec_dict.keys():****
>
>                 extra_spec_list.append(ExtraSpecAux(flavor_id, k,
> extra_spec_dict[k]))****
>
>         except:****
>
>             exceptions.handle(request,****
>
>                               _('Unable to retrieve extra spec list.'))***
> *
>
>         return extra_spec_list****
>
>  ****
>
> class EditView(forms.ModalFormView):****
>
>     form_class = EditFlavor****
>
>     table_class = ExtraSpecsTable****
>
>     template_name = 'syspanel/flavors/edit.html'****
>
>     success_url = reverse_lazy('horizon:syspanel:flavors:index')****
>
>  ****
>
>     def get_context_data(self, **kwargs):****
>
>         context = super(EditView, self).get_context_data(**kwargs)****
>
>         context['flavor_id'] = self.kwargs['id']****
>
>         return context****
>
>  ****
>
>     def get_initial(self):****
>
>         try:****
>
>             flavor = api.nova.flavor_get(self.request, self.kwargs['id'])*
> ***
>
>             extra_spec_list = get_extra_spec_data(self.request,
> self.kwargs['id'])****
>
>         except:****
>
>             exceptions.handle(self.request,****
>
>                               _("Unable to retrieve flavor data."))****
>
>         return {'flavor_id': flavor.id,****
>
>                 'name': flavor.name,****
>
>                 'vcpus': flavor.vcpus,****
>
>                 'memory_mb': flavor.ram,****
>
>                 'disk_gb': flavor.disk,****
>
>                 'eph_gb': getattr(flavor, 'OS-FLV-EXT-DATA:ephemeral',
> None),****
>
>                 'extra_specs': extra_spec_list}****
>
>  ****
>
>  ****
>
> _edit.html****
>
>  ****
>
> Adding****
>
> <div id="extra_specs">****
>
>       {{ extra_specs_table.render }}****
>
> </div>****
>
>  ****
>
>  ****
>
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev****
>
> ** **
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20120904/95848297/attachment-0001.html>


More information about the OpenStack-dev mailing list