#!/usr/bin/python26 ### ### backmon.commands.test ### import sys import os import os.path import glob import re from optparse import OptionParser from ..lib import * usage = 'usage: %prog -e environment test [test]' parser = OptionParser(usage=usage) def run(args, kwargs): # # add kwargs to local namespace # for key in kwargs.keys(): if re.compile('^[A-Z][A-Z_]+$').match(key): exec(key + ' = kwargs[\'' + key + '\']') (options, args) = parser.parse_args(args) if not OPTIONS.environment: ERROR('Please specify an environment to use the test command.') sys.exit(1) elif( len(args) == 0 ): ERROR('No test specified.') sys.exit(1) else: test = args.pop(0) DEBUG('TEST=%s' % (test)) environment = ENVIRONMENTS[ENVIRONMENT] if test == 'buffers': environment.refresh(['aliases']) environment.refresh(['jobs'])