refactor: use explicit conversion in f-strings

This commit is contained in:
Mark Paronyan committed 2026-10-01 19:57:41 +03:00
1 parent 0f66fd6c2b
commit c5b5091f5e
32 files changed
+65 -65

No files matched your search

+4 -4
View File
@@ -97,7 +97,7 @@ class Router(BaseNode):
try:
os.makedirs(os.path.join(self._working_directory, "configs"), exist_ok=True)
except OSError as e:
raise DynamipsError(f"Can't create the dynamips config directory: {str(e)}")
raise DynamipsError(f"Can't create the dynamips config directory: {e!s}")
if dynamips_id:
self._convert_before_2_0_0_b3(dynamips_id)
@@ -153,7 +153,7 @@ class Router(BaseNode):
try:
shutil.move(path, dst)
except OSError as e:
log.error(f"Can't move {path}: {str(e)}")
log.error(f"Can't move {path}: {e!s}")
continue
for path in glob.glob(os.path.join(glob.escape(dynamips_dir), f"*_i{dynamips_id}_*")):
dst = os.path.join(self._working_directory, os.path.basename(path))
@@ -161,7 +161,7 @@ class Router(BaseNode):
try:
shutil.move(path, dst)
except OSError as e:
log.error(f"Can't move {path}: {str(e)}")
log.error(f"Can't move {path}: {e!s}")
continue
def asdict(self):
@@ -1608,7 +1608,7 @@ class Router(BaseNode):
try:
open(output_file, "w+").close()
except OSError as e:
raise DynamipsError(f'Can not write capture to "{output_file}": {str(e)}')
raise DynamipsError(f'Can not write capture to "{output_file}": {e!s}')
try:
adapter = self._slots[slot_number]