← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1306815] [NEW] TypeError in database launch error handle

 

Public bug reported:

openstack_dashboard.dashboards.project.databases.workflows.create_instance in populate_flavor_choices
TypeError: 'NoneType' object is not iterable

If there's an exception in
openstack_dashboard/dashboards/project/databases/workflows/create_instance.py
SetInstanceDetailsAction.flavors, the follow-on method will have a
TypeError.

[code]
    @memoized.memoized_method
    def flavors(self, request):
        try:
            return api.trove.flavor_list(request)
        except Exception:
            LOG.exception("Exception while obtaining flavors list")
            self._flavors = []

    def populate_flavor_choices(self, request, context):
        flavor_list = [(f.id, "%s" % f.name) for f in self.flavors(request)]
        return sorted(flavor_list)
[code]

if self.flavors has an error, it will eventually return a None.

There's 2 options here: 
A) return an empty list
B) redirect to another page

I have to believe that returning an empty list will be more confusing
than a redirect, so I'd like to handle this with exceptions.handle.

** Affects: horizon
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1306815

Title:
  TypeError in database launch error handle

Status in OpenStack Dashboard (Horizon):
  New

Bug description:
  openstack_dashboard.dashboards.project.databases.workflows.create_instance in populate_flavor_choices
  TypeError: 'NoneType' object is not iterable

  If there's an exception in
  openstack_dashboard/dashboards/project/databases/workflows/create_instance.py
  SetInstanceDetailsAction.flavors, the follow-on method will have a
  TypeError.

  [code]
      @memoized.memoized_method
      def flavors(self, request):
          try:
              return api.trove.flavor_list(request)
          except Exception:
              LOG.exception("Exception while obtaining flavors list")
              self._flavors = []

      def populate_flavor_choices(self, request, context):
          flavor_list = [(f.id, "%s" % f.name) for f in self.flavors(request)]
          return sorted(flavor_list)
  [code]

  if self.flavors has an error, it will eventually return a None.

  There's 2 options here: 
  A) return an empty list
  B) redirect to another page

  I have to believe that returning an empty list will be more confusing
  than a redirect, so I'd like to handle this with exceptions.handle.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1306815/+subscriptions


Follow ups

References