From 7b9cfc9caa1c764b2f41bc09394a924170a188c2 Mon Sep 17 00:00:00 2001 From: John Eckersberg Date: Fri, 25 Jan 2008 22:47:59 -0500 Subject: blow away lamo clone for now and implement status --- func/minion/modules/netapp/vol.py | 46 ++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 25 deletions(-) (limited to 'func/minion/modules/netapp') diff --git a/func/minion/modules/netapp/vol.py b/func/minion/modules/netapp/vol.py index cb8cc48..d0bb3d9 100644 --- a/func/minion/modules/netapp/vol.py +++ b/func/minion/modules/netapp/vol.py @@ -40,24 +40,7 @@ class Vol(func_module.FuncModule): """ TODO: Document me ... """ - if len(args)==1: - args = args[0].split() - - if subcmd == 'create': - regex = """Creation of clone volume .* has completed.""" - elif subcmd == 'split': - if args[1] == 'start': - regex = """Clone volume .* will be split from its parent.""" - else: - raise NetappNotImplemented - else: - raise NetappNotImplemented - - output = ssh('root', filer, ' '.join(args)) - if re.search(regex, output): - return True - else: - raise NetappCommandError, output + pass def destroy(self, filer, args): """ @@ -98,37 +81,50 @@ class Vol(func_module.FuncModule): output = ssh('root', filer, cmd_opts) return check_output(regex, output) - def status(self, filer, *args): + def status(self, filer, args): """ TODO: Document me ... """ pass - def size(self, filer, *args): + def size(self, filer, args): """ TODO: Document me ... """ - pass + stat_regex = """vol size: Flexible volume .* has size .*.""" + resize_regex = """vol size: Flexible volume .* size set to .*.""" + param_check(args, ['name']) + cmd_opts = ['vol', 'size', args['name']] + + if len(args.keys()) == 1: + output = ssh('root', filer, cmd_opts) + check_output(stat_regex, output) + return output.split()[-1][:-1] + else: + param_check(args, ['delta']) + cmd_opts.append('%+d%s' % (int(args['delta'][:-1]), args['delta'][-1])) + output = ssh('root', filer, cmd_opts) + return check_output(resize_regex, output) - def options(self, filer, *args): + def options(self, filer, args): """ TODO: Document me ... """ pass - def rename(self, filer, *args): + def rename(self, filer, args): """ TODO: Document me ... """ pass - def restrict(self, filer, *args): + def restrict(self, filer, args): """ TODO: Document me ... """ pass - def split(self, filer, *args): + def split(self, filer, args): """ TODO: Document me ... """ -- cgit