Error in: Tutorial Building a Dashboard using Horizon

Bug #1388576 reported by Fabrizio Fresco
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Low
Fabrizio Fresco

Bug Description

In the view.py example, in this snippet:
--------
        try:
            marker = self.request.GET.get(
                        tables.InstancesTable._meta.pagination_param, None)

            instances, self._has_more = api.nova.server_list(
                self.request,
                search_opts={'marker': marker, 'paginate': True})

            return instances
        except Exception:
            self._has_more = False
            error_message = _('Unable to get instances')
            exceptions.handle(self.request, error_message)

            return instances[]
-----------------
return instances[] is wrong because instances has not been defined.

Changed in openstack-manuals:
assignee: nobody → Fabrizio Fresco (fabrizio-fresco)
affects: openstack-manuals → horizon
Revision history for this message
Julie Pichon (jpichon) wrote :

Looks like a typo to me, it probably meant to be "return []" for the exception. Nicely spotted, thanks!

https://github.com/openstack/horizon/blob/master/doc/source/topics/tutorial.rst

tags: added: low-hanging-fruit
Changed in horizon:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/132469

Changed in horizon:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/132469
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=615c7b10f295590d8a62cbcfe2a0005599e9b303
Submitter: Jenkins
Branch: master

commit 615c7b10f295590d8a62cbcfe2a0005599e9b303
Author: Fabrizio Fresco <email address hidden>
Date: Sun Nov 2 15:41:47 2014 +0000

    Typo in "Tutorial: Building a Dashboard using Horizon"

    In the tutorial "Building a Dashboard using Horizon" there is a bug
    in the view.py example that in case of exception return a var that
    has not been defined.

    Closes-Bug: #1388576
    Change-Id: I271a30215bb245ffa65ee76e86027ae003816a15

Changed in horizon:
status: In Progress → Fix Committed
Akihiro Motoki (amotoki)
Changed in horizon:
milestone: none → kilo-1
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: kilo-1 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.