示例#1
0
def database_add():
#[JPC] refactor routine
    ed = EADatabase()
    ed.simple_db_test()

    snapshot = RancidSnapshotManager()

    dev_snap = snapshot.get_snapshot_single(sys.argv[2])
    ed.insert_dev_file(last_id, dev_snap, sys.argv[3])
示例#2
0
def database_add():
    #[JPC] refactor routine
    ed = EADatabase()
    ed.simple_db_test()

    snapshot = RancidSnapshotManager()

    dev_snap = snapshot.get_snapshot_single(sys.argv[2])
    ed.insert_dev_file(last_id, dev_snap, sys.argv[3])
示例#3
0
def convert_file_database(last_id):
    ea_read = open('snap.dat','r')
    ed = EADatabase()
    ed.simple_db_test()
    ed.simple_db_test()
    for line in ea_read:
        eam = EAMeasurement()
        eam.parse_measurement(line)
        ed.ins_device_sql(last_id, eam.snapshot.dev_manufacturer, eam.snapshot.chassis_type, eam.power_measurement)
        for comp in eam.snapshot.components:
            ed.ins_component_sql(last_id,comp)
        last_id = last_id+1
示例#4
0
def convert_file_database(last_id):
    ea_read = open('snap.dat', 'r')
    ed = EADatabase()
    ed.simple_db_test()
    ed.simple_db_test()
    for line in ea_read:
        eam = EAMeasurement()
        eam.parse_measurement(line)
        ed.ins_device_sql(last_id, eam.snapshot.dev_manufacturer,
                          eam.snapshot.chassis_type, eam.power_measurement)
        for comp in eam.snapshot.components:
            ed.ins_component_sql(last_id, comp)
        last_id = last_id + 1