interface_list() function doesn't work

Bug #1471041 reported by Jonghan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-novaclient
Invalid
Undecided
Unassigned

Bug Description

Openstack Version : python-novaclient-2.23.0-1.el7.noarch
OS : CentOS 7.0
Reproduce steps:
 1. Create VM using python SDK
 2. Call interface_list()

When I try to get VM's interface list using python SDK, interface_list() function returns abnormal result.

In my opinion, _list() function in novaclient/base.py#Manager checks the return value if its type is dictionary, but actually its type is list.

Tags: novaclient
tags: added: novaclient
Revision history for this message
jichenjc (jichenjc) wrote :

seems nova don't have function 'interface_list' ?

no longer affects: nova
Revision history for this message
Jonghan (forhim-park) wrote :

interface_list() function is not a part of nova. It's on the novaclient/v2/servers.py.

Revision history for this message
Jonghan (forhim-park) wrote :

This is the sample code to test this bug.

#!/usr/bin/env python

import os
import novaclient.v2.client as nvclient

def get_nova_credentials() :
    d = {}
    d['username'] = os.environ['OS_USERNAME']
    d['api_key'] = os.environ['OS_PASSWORD']
    d['auth_url'] = os.environ['OS_AUTH_URL'] + "/v2.0"
    d['project_id'] = os.environ['OS_TENANT_NAME']
    return d

nova = nvclient.Client(**get_nova_credentials())

if __name__ == "__main__":
    instances = nova.servers.list()
    for instance in instances:
        interface_list = instance.interface_list()
        print interface_list

And the result is like this :
[<Server: unknown-name>]

Revision history for this message
melanie witt (melwitt) wrote :

Note to others trying to reproduce this: interface_list() is only available with Neutron.

@Jonghan, What is the problem you're seeing? The return value is a list of interfaces, and you should be able to access for example port_id, net_id on the returned objects.

Changed in python-novaclient:
status: New → Incomplete
Jonghan (forhim-park)
Changed in python-novaclient:
status: Incomplete → Invalid
Revision history for this message
Jonghan (forhim-park) wrote :

@melanie
You're right. I investigate this issue more detail and find that it is not a "bug". I changed the status to invalid.

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.