From 029024884af569d11924ec4c5644c675fce11f56 Mon Sep 17 00:00:00 2001 From: liutuo Date: Thu, 12 Dec 2019 11:51:06 +0800 Subject: [PATCH] fix device id contains '/' --- tools/python/utils/util.py | 5 +++-- tools/sh_commands.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/python/utils/util.py b/tools/python/utils/util.py index 3c8bc80c..a6db7bbd 100644 --- a/tools/python/utils/util.py +++ b/tools/python/utils/util.py @@ -208,8 +208,9 @@ def abi_to_internal(abi): # lock ################################ def device_lock(device_id, timeout=7200): - return filelock.FileLock("/tmp/device-lock-%s" % device_id, - timeout=timeout) + return filelock.FileLock( + "/tmp/device-lock-%s" % device_id.replace("/", ""), + timeout=timeout) def is_device_locked(device_id): diff --git a/tools/sh_commands.py b/tools/sh_commands.py index 4b029485..c713b0c2 100644 --- a/tools/sh_commands.py +++ b/tools/sh_commands.py @@ -70,7 +70,7 @@ def device_lock_path(serialno): def device_lock(serialno, timeout=7200): import filelock - return filelock.FileLock(device_lock_path(serialno), timeout=timeout) + return filelock.FileLock(device_lock_path(serialno.replace("/", "")), timeout=timeout) def is_device_locked(serialno): -- GitLab