def initiateDBConnection(): dbinfo = config.database #get the database from the config file dbwrapper = DatabaseWrapper.dbconnect( dbinfo['host']) #try to connect to the database dbwrapper.login( dbinfo['user'], dbinfo['password'], dbinfo['db']) #login to the database with the correct login info return dbwrapper
def initiateDBConnection(): dbinfo = config.database #get the database from the config file dbwrapper = DatabaseWrapper.dbconnect(dbinfo['host']) #try to connect to the database dbwrapper.login(dbinfo['user'], dbinfo['password'],dbinfo['db']) #login to the database with the correct login info return dbwrapper
# # xmlNodeGenerator.py # # # Authors: Del Jackson and Daniel Sawyer # Copyright (c) 2010 __MyCompanyName__. All rights reserved. # # import sys sys.path.append("../database") import DatabaseWrapper, config #connect to database dbinfo = config.database dbwrapper = DatabaseWrapper.dbconnect(dbinfo['host']) dbwrapper.login(dbinfo['user'], dbinfo['password'],dbinfo['db']) dbwrapper.clearNodeStats() nodestats = {"Address" : "", "Team" : "", "OS" : "", "Type" : "unknown"} ServiceList = "" if (len(sys.argv) > 1): log = open(sys.argv[len(sys.argv) - 1]) else: print "Using default file: sampleNDOut.txt" log = open("sampleNDOut.txt") for line in log:
def initiateDBConnection(): dbinfo = config.database dbwrapper = DatabaseWrapper.dbconnect(dbinfo['host']) dbwrapper.login(dbinfo['user'], dbinfo['password'],dbinfo['db']) return dbwrapper
# # xmlNodeGenerator.py # # # Authors: Del Jackson and Daniel Sawyer # Copyright (c) 2010 __MyCompanyName__. All rights reserved. # # Updated by Jarrod Sawyer on 4/22/2011 import sys sys.path.append("../database") # Path of the DatabaseWrapper import DatabaseWrapper, config #connect to database dbinfo = config.database dbwrapper = DatabaseWrapper.dbconnect(dbinfo['host']) dbwrapper.login(dbinfo['user'], dbinfo['password'], dbinfo['db']) dbwrapper.clearNodeStats() nodestats = {"Address": "", "Team": "", "OS": "", "Type": "unknown"} ServiceList = "" if (len(sys.argv) > 1): log = open(sys.argv[len(sys.argv) - 1]) else: print "Using default file: sampleNDOut.txt" log = open("sampleNDOut.txt") # Goes through each line of the log file parsing out the required node detection information.
def initiateDBConnection(): dbinfo = config.database dbwrapper = DatabaseWrapper.dbconnect(dbinfo['host']) dbwrapper.login(dbinfo['user'], dbinfo['password'], dbinfo['db']) return dbwrapper