Follow pep8 norm

Change-Id: I0314a383a78eac354c4a41afaa1778f9e94efca6
This commit is contained in:
jiangzhilin 2023-06-28 14:47:49 +08:00
parent b0e7892d2f
commit ef5315e47a
4 changed files with 6 additions and 6 deletions

View File

@ -192,7 +192,7 @@ def fpga_device(path):
if filename in DEVICE_EXPOSED:
key = DEVICE_FILE_MAP.get(filename) or filename
if key in DEVICE_FILE_HANDLER and callable(
DEVICE_FILE_HANDLER(key)):
DEVICE_FILE_HANDLER(key)):
infos[key] = DEVICE_FILE_HANDLER(key)(
os.path.join(dirpath, filename))
else:

View File

@ -102,7 +102,7 @@ def _combine_device_by_pci_func(pci_devices):
existed_addr = fpga.get('pci_addr')[0]
# compare domain:bus:slot
if existed_addr and \
new_addr.split('.')[0] == existed_addr.split('.')[0]:
new_addr.split('.')[0] == existed_addr.split('.')[0]:
fpga.update({'pci_addr': [existed_addr, new_addr]})
is_existed = True
if not is_existed:

View File

@ -213,7 +213,7 @@ class DeviceProfilesController(base.CyborgController,
inner_origin_rc = ":".join(key.split(":")[1:])
inner_rc = inner_origin_rc.strip(" ")
if inner_rc not in constants.SUPPORT_RESOURCES and \
not inner_rc.startswith('CUSTOM_'):
not inner_rc.startswith('CUSTOM_'):
raise exception.InvalidParameterValue(
err="Unsupported resource class %s" % inner_rc)
try:

View File

@ -206,8 +206,8 @@ class _Singleton(type):
def __call__(cls, *args, **kwargs):
ins = cls._instances.get(cls)
if not ins or (
hasattr(ins, "_reset") and isinstance(ins, cls) and ins._reset()):
if not ins or (hasattr(ins, "_reset")
and isinstance(ins, cls) and ins._reset()):
cls._instances[cls] = super(
_Singleton, cls).__call__(*args, **kwargs)
@ -238,7 +238,7 @@ class ThreadPoolExecutor(CFThreadPoolExecutor):
# cause hang the main thread with eventlet.monkey_patch. Change it
# to queue._PySimpleQueue
if hasattr(queue, "SimpleQueue") and not isinstance(
self._work_queue, queue._PySimpleQueue):
self._work_queue, queue._PySimpleQueue):
self._work_queue = queue._PySimpleQueue()