← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1202415] Re: __repr__ added to ApiResourceWrapper breaks e.g. Server list

 

** Changed in: horizon
       Status: Fix Committed => Fix Released

-- 
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/1202415

Title:
  __repr__ added to ApiResourceWrapper breaks e.g. Server list

Status in OpenStack Dashboard (Horizon):
  Fix Released

Bug description:
  The recent patch "Neutron Security Group native support" added a
  __repr__ function to APIResourceWrapper.

  But this now throws an error if any attributes in _attrs are not
  defined, which happens for me when I browse to the server list screen
  in horizon (note that I'm using a "special" version of nova which
  doesn't necessarily have the exact same JSON data).  In particular,
  for servers, __repr__ now requires "attrs" and "private_ip", both of
  which I think are not in the OpenStack API spec (that I could find).

  +    def __repr__(self):
  +        return "<%s: %s>" % (self.__class__.__name__,
  +                               dict((attr,
  +                                     getattr(self, attr))
  +                                    for attr in self._attrs))
  +

  I'm not entirely sure why __repr__ was included in this patch, so I'm
  not comfortable just proposing a patch to rip it out.

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