From 620171f26e281ce6d2c92073f90f661ca4352608 Mon Sep 17 00:00:00 2001 From: John Eckersberg Date: Tue, 29 Jan 2008 20:41:01 -0500 Subject: flesh out clone module to allow creation and splitting --- func/minion/modules/netapp/vol/clone.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'func/minion') diff --git a/func/minion/modules/netapp/vol/clone.py b/func/minion/modules/netapp/vol/clone.py index 510c37d..ab1071d 100644 --- a/func/minion/modules/netapp/vol/clone.py +++ b/func/minion/modules/netapp/vol/clone.py @@ -1,7 +1,7 @@ ## ## NetApp Filer 'vol.clone' Module ## -## Copyright 2007, Red Hat, Inc +## Copyright 2008, Red Hat, Inc ## John Eckersberg ## ## This software may be freely redistributed under the terms of the GNU @@ -27,12 +27,11 @@ class Clone(func_module.FuncModule): """ TODO: Document me ... """ - return True - regex = """Creation of volume .* has completed.""" - param_check(args, ['name', 'aggr', 'size']) + regex = """Creation of clone volume .* has completed.""" + param_check(args, ['name', 'parent', 'snapshot']) - cmd_opts = ['vol', 'create'] - cmd_opts.extend([args['name'], args['aggr'], args['size']]) + cmd_opts = ['vol', 'clone', 'create'] + cmd_opts.extend([args['name'], '-b', args['parent'], args['snapshot']]) output = ssh(filer, cmd_opts) return check_output(regex, output) @@ -41,5 +40,14 @@ class Clone(func_module.FuncModule): """ TODO: Document me ... """ - return True + # only worry about 'start' now, I don't terribly care to automate the rest + regex = """Clone volume .* will be split from its parent.""" + param_check(args, ['name']) + + cmd_opts = ['vol', 'clone', 'split', 'start', args['name']] + + output = ssh(filer, cmd_opts) + return check_output(regex, output) + + -- cgit