diff options
author | John Eckersberg <jeckersb@redhat.com> | 2008-01-28 16:01:10 -0500 |
---|---|---|
committer | John Eckersberg <jeckersb@redhat.com> | 2008-01-28 16:01:10 -0500 |
commit | 29cbceab3401c106e6619da58f7609fb569899df (patch) | |
tree | 0e0819b0c59a523e3af8c81d9c9a8a265c5b7169 /func/minion | |
parent | b2f42f64df9b7773f5834b8869213a2fb8b0dc3d (diff) | |
download | third_party-func-29cbceab3401c106e6619da58f7609fb569899df.tar.gz third_party-func-29cbceab3401c106e6619da58f7609fb569899df.tar.xz third_party-func-29cbceab3401c106e6619da58f7609fb569899df.zip |
initial snap module
Diffstat (limited to 'func/minion')
-rw-r--r-- | func/minion/modules/netapp/snap.py | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/func/minion/modules/netapp/snap.py b/func/minion/modules/netapp/snap.py new file mode 100644 index 0000000..be27b68 --- /dev/null +++ b/func/minion/modules/netapp/snap.py @@ -0,0 +1,57 @@ +## +## NetApp Filer 'snap' Module +## +## Copyright 2007, Red Hat, Inc +## John Eckersberg <jeckersb@redhat.com> +## +## This software may be freely redistributed under the terms of the GNU +## general public license. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +## + +import re +from func.minion.modules import func_module +from func.minion.modules.netapp.common import * + +class Snap(func_module.FuncModule): + + # Update these if need be. + version = "0.0.1" + api_version = "0.0.1" + description = "Interface to the 'snap' command" + + def create(self, filer, args): + """ + TODO: Document me ... + """ + regex = """creating snapshot...""" + param_check(args, ['volname', 'snapname']) + + cmd_opts = ['snap', 'create'] + cmd_opts.extend([args['volname'], args['snapname']]) + + output = ssh(filer, cmd_opts) + return check_output(regex, output) + + def delete(self, filer, args): + """ + TODO: Document me ... + """ + regex = """deleting snapshot...""" + param_check(args, ['volname', 'snapname']) + + cmd_opts = ['snap', 'delete'] + cmd_opts.extend([args['volname'], args['snapname']]) + + output = ssh(filer, cmd_opts) + return check_output(regex, output) + + def list(self, filer, args): + """ + TODO: Document me ... + """ + return True + |