Skip to content

Commit 60cba4e

Browse files
author
Nikolai Lambrov
committed
Enhance VmUpdater by adding update_vm_config_path method
- Introduced a new method in the VmUpdater class to refresh the VM configuration path from VM info, improving clarity and ensuring the path is always up-to-date. - Updated the existing logic to call this method when retrieving the VM configuration path and updating the VM directory, enhancing the overall functionality of VM management.
1 parent 5b87f28 commit 60cba4e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

frameworks/vm_manager/vm_updater.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def update_vm_dir(self) -> None:
7777
"""
7878
Update VM directory for VM.
7979
"""
80+
self.update_vm_config_path()
8081
self.__vm_dir = Path(self.vm_config_path).parent if self.vm_config_path else Path(self.vm.info.default_vm_dir) / self.vm.name
8182

8283
@property
@@ -85,9 +86,15 @@ def vm_config_path(self) -> Optional[str]:
8586
Get VM configuration path for VM.
8687
"""
8788
if self.__vm_config_path is None:
88-
self.__vm_config_path = self.vm.info.config_path
89+
self.update_vm_config_path()
8990
return self.__vm_config_path
9091

92+
def update_vm_config_path(self) -> None:
93+
"""
94+
Update VM configuration path by refreshing from VM info.
95+
"""
96+
self.__vm_config_path = self.vm.info.config_path
97+
9198
@property
9299
def s3_object_metadata(self) -> dict:
93100
"""

0 commit comments

Comments
 (0)