summaryrefslogtreecommitdiffstats
path: root/func
diff options
context:
space:
mode:
authorJohn Eckersberg <jeckersb@redhat.com>2008-02-03 12:05:27 -0500
committerJohn Eckersberg <jeckersb@redhat.com>2008-02-03 12:05:27 -0500
commitae4702fb3cddf93c5beb5b18c510c01becf13ceb (patch)
treed2b08321e2e2c3d69a7b2d13b2e1e1977a535b22 /func
parentd316373e599dd397ba12414337442c9ee7c5398c (diff)
downloadthird_party-func-ae4702fb3cddf93c5beb5b18c510c01becf13ceb.tar.gz
third_party-func-ae4702fb3cddf93c5beb5b18c510c01becf13ceb.tar.xz
third_party-func-ae4702fb3cddf93c5beb5b18c510c01becf13ceb.zip
- fix bug where the last volume would get left off
- raise exception if vol given does not exist
Diffstat (limited to 'func')
-rw-r--r--func/minion/modules/netapp/vol/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/func/minion/modules/netapp/vol/__init__.py b/func/minion/modules/netapp/vol/__init__.py
index 84c7ea1..14ce0ac 100644
--- a/func/minion/modules/netapp/vol/__init__.py
+++ b/func/minion/modules/netapp/vol/__init__.py
@@ -82,9 +82,13 @@ class Vol(func_module.FuncModule):
else:
current_vol['status'].extend([foo for foo in tokens if '=' not in foo])
current_vol['options'].extend([foo for foo in tokens if '=' in foo])
+ vols.append(current_vol)
if vol:
- return [foo for foo in vols if foo['name'] == vol][0]
+ try:
+ return [foo for foo in vols if foo['name'] == vol][0]
+ except:
+ raise NetappCommandError, "No such volume: %s" % vol
else:
return vols