From ae4702fb3cddf93c5beb5b18c510c01becf13ceb Mon Sep 17 00:00:00 2001 From: John Eckersberg Date: Sun, 3 Feb 2008 12:05:27 -0500 Subject: - fix bug where the last volume would get left off - raise exception if vol given does not exist --- func/minion/modules/netapp/vol/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit