mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 22:11:14 +02:00
refactor: use iterable unpacking instead of concatenation
This commit is contained in:
5 files changed
+9
-9
No files matched your search
@@ -40,7 +40,7 @@ def unpack_zip(filename, extract_dir=None):
|
||||
with zipfile.ZipFile(filename, "r") as zfile:
|
||||
for zinfo in zfile.infolist():
|
||||
fname = os.path.join(extract_dir, zinfo.filename)
|
||||
date_time = time.mktime(zinfo.date_time + (0, 0, -1))
|
||||
date_time = time.mktime((*zinfo.date_time, 0, 0, -1))
|
||||
zfile.extract(zinfo, extract_dir)
|
||||
|
||||
# update timestamp
|
||||
|
||||
@@ -146,7 +146,7 @@ class VirtualBoxVM(BaseNode):
|
||||
"""
|
||||
|
||||
args = shlex.split(params)
|
||||
result = await self.manager.execute("controlvm", [self._uuid] + args)
|
||||
result = await self.manager.execute("controlvm", [self._uuid, *args])
|
||||
return result
|
||||
|
||||
async def _modify_vm(self, params):
|
||||
@@ -157,7 +157,7 @@ class VirtualBoxVM(BaseNode):
|
||||
"""
|
||||
|
||||
args = shlex.split(params)
|
||||
await self.manager.execute("modifyvm", [self._uuid] + args)
|
||||
await self.manager.execute("modifyvm", [self._uuid, *args])
|
||||
|
||||
async def _check_duplicate_linked_clone(self):
|
||||
"""
|
||||
@@ -866,7 +866,7 @@ class VirtualBoxVM(BaseNode):
|
||||
"""
|
||||
|
||||
args = shlex.split(params)
|
||||
await self.manager.execute("storageattach", [self._uuid] + args)
|
||||
await self.manager.execute("storageattach", [self._uuid, *args])
|
||||
|
||||
async def _get_nic_attachements(self, maximum_adapters):
|
||||
"""
|
||||
|
||||
Reference in new issue
Block a user