Created
April 28, 2017 20:38
-
-
Save kamidzi/649831675b7776fd3248d757ec5ef7ea to your computer and use it in GitHub Desktop.
Nova client test - DOB1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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