2 ## NetApp Filer 'vol.clone' Module
4 ## Copyright 2008, Red Hat, Inc
5 ## John Eckersberg <jeckersb@redhat.com>
7 ## This software may be freely redistributed under the terms of the GNU
8 ## general public license.
10 ## You should have received a copy of the GNU General Public License
11 ## along with this program; if not, write to the Free Software
12 ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 from func
.minion
.modules
import func_module
17 from func
.minion
.modules
.netapp
.common
import *
19 class Clone(func_module
.FuncModule
):
21 # Update these if need be.
24 description
= "Interface to the 'vol' command"
26 def create(self
, filer
, vol
, parent
, snap
):
30 regex
= """Creation of clone volume .* has completed."""
31 cmd_opts
= ['vol', 'clone', 'create', vol
, '-b', parent
, snap
]
32 output
= ssh(filer
, cmd_opts
)
33 return check_output(regex
, output
)
35 def split(self
, filer
, vol
):
39 # only worry about 'start' now, I don't terribly care to automate the rest
40 regex
= """Clone volume .* will be split from its parent."""
41 cmd_opts
= ['vol', 'clone', 'split', 'start', vol
]
42 output
= ssh(filer
, cmd_opts
)
43 return check_output(regex
, output
)