powervc-driver/cinder-powervc/test/cinderclienttest.py
Le Tian Ren bb7da09624 Fix copyright headline in the source files
Change-Id: Ie1b0dac8a8ec1e6d02217fe03159c78a69f6dc5d
Closes-Bug: #1317657
2014-05-09 13:05:20 +08:00

23 lines
546 B
Python

# Copyright 2013 IBM Corp.
"""
Simple cinder client tests
TODO: Convert to pyunit and use config file
"""
import powervc.common.constants as constants
from powervc.common import config
config.parse_power_config((), 'powervc')
import powervc.common.client.factory as clients
cinder_client = clients.POWERVC.new_client(str(constants.SERVICE_TYPES.volume))
print '=' * 10, 'Listing volumes', '=' * 10
vol_list = cinder_client.volumes.list()
for vol in vol_list:
print str(vol.display_name), str(vol.display_description), \
vol.id