From c83e15d040c0d021913673fd74d3d1b3944abc4e Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 22 May 2017 00:06:03 +0800 Subject: [PATCH] artiq_corelog: cleanup --- artiq/frontend/artiq_corelog.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/artiq/frontend/artiq_corelog.py b/artiq/frontend/artiq_corelog.py index 88bc996c7..5ba31ac32 100755 --- a/artiq/frontend/artiq_corelog.py +++ b/artiq/frontend/artiq_corelog.py @@ -4,13 +4,12 @@ import argparse from artiq.tools import verbosity_args, init_logger from artiq.master.databases import DeviceDB -from artiq.master.worker_db import DeviceManager from artiq.coredevice.comm_mgmt import CommMgmt def get_argparser(): parser = argparse.ArgumentParser(description="ARTIQ core device " - "log download tool") + "log tool") verbosity_args(parser) parser.add_argument("--device-db", default="device_db.py", help="device database file (default: '%(default)s')") @@ -37,10 +36,10 @@ def get_argparser(): def main(): args = get_argparser().parse_args() init_logger(args) - device_mgr = DeviceManager(DeviceDB(args.device_db)) + + core_addr = DeviceDB(args.device_db).get("comm")["arguments"]["host"] + mgmt = CommMgmt(None, core_addr) try: - core_addr = device_mgr.get_desc("comm")["arguments"]["host"] - mgmt = CommMgmt(device_mgr, core_addr) if args.action == "set_level": mgmt.set_log_level(args.level) elif args.action == "set_uart_level": @@ -50,7 +49,7 @@ def main(): else: print(mgmt.get_log(), end="") finally: - device_mgr.close_devices() + mgmt.close() if __name__ == "__main__":