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

+1 -1
View File
@@ -334,7 +334,7 @@ class GNS3VM:
await engine.start()
except Exception as e:
await self._controller.delete_compute("vm")
log.error(f"Cannot start the GNS3 VM: {str(e)}")
log.error(f"Cannot start the GNS3 VM: {e!s}")
await compute.update(name=f"GNS3 VM ({engine.vmname})")
compute.set_last_error(str(e))
raise e
@@ -260,7 +260,7 @@ class VirtualBoxGNS3VM(BaseGNS3VM):
await self._check_requirements()
return await self._virtualbox_manager.list_vms()
except VirtualBoxError as e:
raise GNS3VMError(f"Could not list VirtualBox VMs: {str(e)}")
raise GNS3VMError(f"Could not list VirtualBox VMs: {e!s}")
async def start(self):
"""
@@ -116,7 +116,7 @@ class VMwareGNS3VM(BaseGNS3VM):
try:
return await self._vmware_manager.list_vms()
except VMwareError as e:
raise GNS3VMError(f"Could not list VMware VMs: {str(e)}")
raise GNS3VMError(f"Could not list VMware VMs: {e!s}")
async def start(self):
"""
@@ -143,7 +143,7 @@ class VMwareGNS3VM(BaseGNS3VM):
try:
running = await self._is_running()
except VMwareError as e:
raise GNS3VMError(f"Could not list VMware VMs: {str(e)}")
raise GNS3VMError(f"Could not list VMware VMs: {e!s}")
if not running:
# set the number of vCPUs and amount of RAM
if self.allocate_vcpus_ram:
@@ -197,7 +197,7 @@ class VMwareGNS3VM(BaseGNS3VM):
try:
await self._execute("suspend", [self._vmx_path])
except GNS3VMError as e:
log.warning(f"Error when suspending the VM: {str(e)}")
log.warning(f"Error when suspending the VM: {e!s}")
log.info("GNS3 VM has been suspended")
self.running = False
@@ -211,6 +211,6 @@ class VMwareGNS3VM(BaseGNS3VM):
try:
await self._execute("stop", [self._vmx_path, "soft"])
except GNS3VMError as e:
log.warning(f"Error when stopping the VM: {str(e)}")
log.warning(f"Error when stopping the VM: {e!s}")
log.info("GNS3 VM has been stopped")
self.running = False