#!/usr/bin/python26 ### ### backmon.commands.db.test ### import sys import os import os.path import glob import re from optparse import OptionParser from guppy import hpy from ....lib import * from backup_monitoring.debug import * from backup_monitoring.math import * from backup_monitoring.parsing.parsers import bpstulist from backup_monitoring.parsing.parsers import df from backup_monitoring.parsing.parsers import dsu_ls_l from backup_monitoring.parsing.parsers import nbstlutil from backup_monitoring.parsing.parsers import nbdevquery from backup_monitoring.parsing.parsers import bpdbjobs usage = 'usage: %prog db 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) # # Test Database Connection # conn = CONN curs = conn.cursor() curs.execute ("SELECT VERSION()") row = curs.fetchone () print "server version:", row[0] curs.close () conn.close ()