diff options
author | John Eckersberg <jeckersb@redhat.com> | 2008-02-03 12:05:27 -0500 |
---|---|---|
committer | John Eckersberg <jeckersb@redhat.com> | 2008-02-03 12:05:27 -0500 |
commit | ae4702fb3cddf93c5beb5b18c510c01becf13ceb (patch) | |
tree | d2b08321e2e2c3d69a7b2d13b2e1e1977a535b22 /func/minion/modules | |
parent | d316373e599dd397ba12414337442c9ee7c5398c (diff) | |
download | func-ae4702fb3cddf93c5beb5b18c510c01becf13ceb.tar.gz func-ae4702fb3cddf93c5beb5b18c510c01becf13ceb.tar.xz 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/minion/modules')
-rw-r--r-- | func/minion/modules/netapp/vol/__init__.py | 6 |
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 |