From 5fc953119e1886e82cbc3f249bdb0c987ab6fa31 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 22 May 2017 17:32:11 +0800 Subject: [PATCH] fix usage of CommMgmt --- artiq/frontend/artiq_coreboot.py | 9 ++++----- artiq/frontend/artiq_corelog.py | 2 +- artiq/test/coredevice/test_rtio.py | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/artiq/frontend/artiq_coreboot.py b/artiq/frontend/artiq_coreboot.py index c39c267e8..c0136292e 100755 --- a/artiq/frontend/artiq_coreboot.py +++ b/artiq/frontend/artiq_coreboot.py @@ -6,7 +6,6 @@ import struct 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 @@ -34,10 +33,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("core")["arguments"]["host"] + mgmt = CommMgmt(core_addr) try: - core_addr = device_mgr.get_desc("core")["arguments"]["host"] - mgmt = CommMgmt(device_mgr, core_addr) if args.action == "reboot": mgmt.reboot() elif args.action == "hotswap": @@ -46,7 +45,7 @@ def main(): print("An action needs to be specified.", file=sys.stderr) sys.exit(1) finally: - device_mgr.close_devices() + mgmt.close() if __name__ == "__main__": main() diff --git a/artiq/frontend/artiq_corelog.py b/artiq/frontend/artiq_corelog.py index 475386fa7..0f7cd8759 100755 --- a/artiq/frontend/artiq_corelog.py +++ b/artiq/frontend/artiq_corelog.py @@ -38,7 +38,7 @@ def main(): init_logger(args) core_addr = DeviceDB(args.device_db).get("core")["arguments"]["host"] - mgmt = CommMgmt(None, core_addr) + mgmt = CommMgmt(core_addr) try: if args.action == "set_level": mgmt.set_log_level(args.level) diff --git a/artiq/test/coredevice/test_rtio.py b/artiq/test/coredevice/test_rtio.py index 1c75ab7ee..1a84b2f7d 100644 --- a/artiq/test/coredevice/test_rtio.py +++ b/artiq/test/coredevice/test_rtio.py @@ -403,7 +403,7 @@ class CoredeviceTest(ExperimentCase): def test_collision(self): core_addr = self.device_mgr.get_desc("core")["arguments"]["host"] - mgmt = CommMgmt(self.device_mgr, core_addr) + mgmt = CommMgmt(core_addr) mgmt.clear_log() self.execute(Collision) log = mgmt.get_log() @@ -412,7 +412,7 @@ class CoredeviceTest(ExperimentCase): def test_address_collision(self): core_addr = self.device_mgr.get_desc("core")["arguments"]["host"] - mgmt = CommMgmt(self.device_mgr, core_addr) + mgmt = CommMgmt(core_addr) mgmt.clear_log() self.execute(AddressCollision) log = mgmt.get_log()