Skip to content

Instantly share code, notes, and snippets.

@kamidzi
Created April 28, 2017 20:38
Show Gist options
  • Save kamidzi/649831675b7776fd3248d757ec5ef7ea to your computer and use it in GitHub Desktop.
Save kamidzi/649831675b7776fd3248d757ec5ef7ea to your computer and use it in GitHub Desktop.
Nova client test - DOB1
#!/usr/bin/env python
from novaclient import client
import os
import sys
VERSION = 2
params = [
('api_version', 2,),
('username', os.environ.get('OS_USERNAME'),),
('password', os.environ.get('OS_PASSWORD'),),
('project_name', os.environ.get('OS_PROJECT_NAME'),),
('os_auth_url', os.environ.get('OS_AUTH_URL', 'https://openstack.dob1.bcpc.bloomberg.com:5000/v2.0')),
]
for k,v in params:
if v is None:
sys.exit('Set %s via corresponding envvar!' % k)
novaclient = client.Client(*tuple([v for k,v in params]))
print novaclient.images.list()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment