forked from M-Labs/artiq
1
0
Fork 0

artiq_coremgmt: add option to specify core device address directly

This commit is contained in:
Sebastien Bourdeauducq 2018-08-18 10:58:40 +08:00
parent fc09144baa
commit a7810502f6
1 changed files with 7 additions and 1 deletions

View File

@ -17,6 +17,9 @@ def get_argparser():
verbosity_args(parser) verbosity_args(parser)
parser.add_argument("--device-db", default="device_db.py", parser.add_argument("--device-db", default="device_db.py",
help="device database file (default: '%(default)s')") help="device database file (default: '%(default)s')")
parser.add_argument("-D", "--device", default=None,
help="use specified core device address instead of "
"reading device database")
tools = parser.add_subparsers(dest="tool") tools = parser.add_subparsers(dest="tool")
tools.required = True tools.required = True
@ -133,7 +136,10 @@ def main():
args = get_argparser().parse_args() args = get_argparser().parse_args()
init_logger(args) init_logger(args)
if args.device is None:
core_addr = DeviceDB(args.device_db).get("core")["arguments"]["host"] core_addr = DeviceDB(args.device_db).get("core")["arguments"]["host"]
else:
core_addr = args.device
mgmt = CommMgmt(core_addr) mgmt = CommMgmt(core_addr)
if args.tool == "log": if args.tool == "log":