volume_action doesn't always need names

for example, volume_list
This commit is contained in:
Daniel Wallace 2014-03-09 21:59:39 -05:00
parent 31f9d49ea9
commit 18da08cbd6
3 changed files with 10 additions and 1 deletions

View File

@ -322,6 +322,7 @@ class CloudClient(object):
return False
if isinstance(names, str):
names = names.split(',')
ret = {}
for name in names:
volume_ = kwargs.copy()

View File

@ -831,3 +831,11 @@ def volume_attach(name, server_name, device='/dev/xvdb', **kwargs):
device,
timeout=300
)
def volume_list(**kwargs):
'''
Attach block volume
'''
conn = get_conn()
return conn.volume_list()

View File

@ -213,7 +213,7 @@ def volume_list(provider):
'''
client = _get_client()
info = client.volume_action(provider, action='list')
info = client.volume_action(provider, 'name', action='list')
return info