提交 02902488 编写于 作者: L liutuo

fix device id contains '/'

上级 fc973e7d
...@@ -208,7 +208,8 @@ def abi_to_internal(abi): ...@@ -208,7 +208,8 @@ def abi_to_internal(abi):
# lock # lock
################################ ################################
def device_lock(device_id, timeout=7200): def device_lock(device_id, timeout=7200):
return filelock.FileLock("/tmp/device-lock-%s" % device_id, return filelock.FileLock(
"/tmp/device-lock-%s" % device_id.replace("/", ""),
timeout=timeout) timeout=timeout)
......
...@@ -70,7 +70,7 @@ def device_lock_path(serialno): ...@@ -70,7 +70,7 @@ def device_lock_path(serialno):
def device_lock(serialno, timeout=7200): def device_lock(serialno, timeout=7200):
import filelock 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): def is_device_locked(serialno):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册