Skip to content

Commit 9c83f34

Browse files
author
Nikolai Lambrov
committed
Refactor VboxMachine OS name handling to improve clarity
- Updated the VboxMachine class to conditionally append 'arm64' to the OS name based on the VM name, enhancing the clarity of OS identification.
1 parent b9dbd43 commit 9c83f34

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

frameworks/VboxMachine/VboxMachine.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,10 @@ def os_name(self) -> str:
109109
os_type = self.vm.get_parameter('ostype')
110110
if os_type is None:
111111
raise ValueError("OS type is not available")
112+
self.__os_name = re.sub(r' \([^)]*bit\)', '', os_type).lower()
112113
prefix = 'arm64' if 'arm64' in self.vm.name.lower() else ''
113-
self.__os_name = re.sub(r' \([^)]*bit\)', '', os_type).lower() + f' {prefix}' if prefix else ''
114+
if prefix:
115+
self.__os_name += f' {prefix}'
114116
return self.__os_name
115117

116118
def run(self, headless: bool = True, status_bar: bool = False, timeout: int = 600):

0 commit comments

Comments
 (0)