Ask Your Question

navanitachora's profile - activity

2017-04-13 04:00:55 -0500 received badge  Popular Question (source)
2016-12-15 02:46:05 -0500 received badge  Popular Question (source)
2016-04-27 17:04:49 -0500 asked a question Caching images from glance

Hi,

I am working with OpenStack Horizon and I want to cache the results from glance image API V2 in memcache, for subsequent requests.

The issue I am having is that the list I get from glance, returns the images with a class warlock.core.image and when I try to save them in the cache, python throws a pickling error like so:

Can't pickle <class 'warlock.core.image'="">: it's not found as warlock.core.image

From what I know of warlock, all it defines is a JSON structure which should be pickle able. When I print out the images all I get is a list of key value pairs, so I am not sure why the pickle error is coming up.

I am also puzzled by the "It's not found as warlock.core.image" part of the message.

If it is not possible to pickle warlock objects, are there any alternatives that I could use to cache the images?

Thanks in advance, nav

2015-11-02 18:39:21 -0500 asked a question accessible_panels template variable in openstack horizon juno

am in the process of customizing the Horizon Juno interface and wanted to know about a particular template variable called "accessible_panels".

This variable is in the horizon/templates/horizon/_subnav_list.html template.

I cannot find accessible_panels to be defined anywhere in the codebase and I was wondering what this variable is used for.

Currently it comes up empty for me and as a result some of the panels I want to show do not show up. If I comment it out everything works.

The code for the template is below (Note: I have commented out accessible_panels to show the working template):

{% load horizon %}

{% for heading, panels in components.iteritems %}
  {% with panels|has_permissions_on_list:user as filtered_panels %}
    {% if filtered_panels %}
{#      {% if accessible_panels %}#}
        {% if heading %}<h4>{{ heading }}</h4>{% endif %}
{#      {% endif %}#}
      <ul class="main_nav">
        {% for panel in filtered_panels %}
{#          {% if panel in accessible_panels or current == panel.slug %}#}
            <li>
              <a href="{{ panel.get_absolute_url }}" {% if current == panel.slug %}class="active"{% endif %} tabindex='1'>{{ panel.name }}</a>
            </li>
{#          {% endif %}#}
        {% endfor %}
      </ul>
    {% endif %}
  {% endwith %}
{% endfor %}

My understanding of django templates tells me that this variable has to be defined somewhere but I cannot find it.

I asked this question in StackOverflow but got no replies. I am hoping someone here can help me out.

Cheers, nav