Cleanup ======= This bug report has the status "Incomplete" since more than 30 days and it looks like that there are no open reviews for it. To keep the bug list sane, I close this bug with "won't fix". This does not mean that it is not a valid bug report, it's more to acknowledge that no progress can be expected here anymore. You are still free to push a new patch for this bug. If you could reproduce it on the current master code or on a maintained stable branch, please switch it to "Confirmed".
** Changed in: nova Status: Incomplete => Won't Fix -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/1505434 Title: os-hypervisors servers API does not properly serialize hypervisor with no instance. Status in OpenStack Compute (nova): Won't Fix Bug description: HypervisorsController._view_hypervisor only sets hypervisor['servers'] when servers passed in is non empty list (if servers:). Instead it should check to see if servers is not passed in (if servers is not None:). The reason why this is useful is that currently novaclient would return a Resource object with no servers attribute set, because it only deserializes what the API returns. Therefore, when using the novaclient to get hypervisor servers, it requires an additional hasattr(hypervisor, 'servers') check. This is a pretty standard convention for any API that is expected to return a list to return an empty list to indicate that there is no item. Git version: 02b7e64b29dd707c637ea7026d337e5cb196f337v Reproduce steps: 1. Have a hypervisor with no instances on it. 2. Call any API that is expected to return hypervisor object that also return the instances in it. 2.1. This API should indirectly call HypervisorsController._view_hypervisor and pass the servers argument. i.e. HypervisorsController.servers 3. Notice that for hypervisor with instances, the hypervisor object has a list of servers set. While the hypervisor that does not have any instances, it would not have the servers attribute set at all. To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1505434/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp