It seems all right on my environment, I ran this as follows:
[root@int32bit-centos ~(keystone_admin)]# cat test.py import os import time
from novaclient import client
def get_nova_creds(): d = {} d['username'] = os.environ['OS_USERNAME'] d['api_key'] = os.environ['OS_PASSWORD'] d['auth_url'] = os.environ['OS_AUTH_URL'] d['project_id'] = os.environ['OS_TENANT_NAME'] print d return d
def main(): creds = get_nova_creds() nova = client.Client(version=2,**creds) footest = nova.servers.get('d61af42c-d3b3-488a-98e2-2dc283b7c56b') print footest.interface_list()
if __name__ == '__main__': main() [root@int32bit-centos ~(keystone_admin)]# python test.py {'username': 'admin', 'project_id': 'admin', 'api_key': '8b9dada240e4476e', 'auth_url': 'http://192.168.0.4:5000/v2.0'} [<NetworkInterface: b9512ecc-0981-42ea-b2eb-d6a34089f9cf>]
It seems work fine.
It seems all right on my environment, I ran this as follows:
[root@int32bit- centos ~(keystone_admin)]# cat test.py
import os
import time
from novaclient import client
def get_nova_creds(): 'OS_USERNAME' ] 'OS_PASSWORD' ] 'OS_AUTH_ URL'] 'OS_TENANT_ NAME']
d = {}
d['username'] = os.environ[
d['api_key'] = os.environ[
d['auth_url'] = os.environ[
d['project_id'] = os.environ[
print d
return d
def main(): Client( version= 2,**creds) get('d61af42c- d3b3-488a- 98e2-2dc283b7c5 6b') interface_ list()
creds = get_nova_creds()
nova = client.
footest = nova.servers.
print footest.
if __name__ == '__main__': centos ~(keystone_admin)]# python test.py 192.168. 0.4:5000/ v2.0'} 0981-42ea- b2eb-d6a34089f9 cf>]
main()
[root@int32bit-
{'username': 'admin', 'project_id': 'admin', 'api_key': '8b9dada240e4476e', 'auth_url': 'http://
[<NetworkInterface: b9512ecc-
It seems work fine.