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])
def file_add(): #File add ea_write = open('snap.dat','a') em = EAMeasurement() #ed.simple_db_test() snapshot = RancidSnapshotManager("") dev_snap = snapshot.get_snapshot_single(sys.argv[2]) em.write_measurement(ea_write, dev_snap, sys.argv[3]) ea_write.close()
def file_add(): #File add ea_write = open('snap.dat', 'a') em = EAMeasurement() #ed.simple_db_test() snapshot = RancidSnapshotManager("") dev_snap = snapshot.get_snapshot_single(sys.argv[2]) em.write_measurement(ea_write, dev_snap, sys.argv[3]) ea_write.close()
#!/usr/bin/env python import sys from EnergyAuditProfile import EnergyAuditProfile from SnapshotManager import RancidSnapshotManager profile = EnergyAuditProfile() profile.open_profile() snapshots = RancidSnapshotManager(profile) #This is for normal rancid if len(sys.argv) == 1: snapshots.take_dev_snapshot() snapshots.run_audit_file("snap.dat") else: print "DOIT Snapshot" snapshots.take_doit_snapshot() print "snapshots complete" snapshots.run_audit_file("snap.dat")