mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
refactor: use explicit conversion in f-strings
This commit is contained in:
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
|
||||
Reference in new issue
Block a user