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

@@ -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