Skip to content

Commit 6c5bc07

Browse files
author
LittleCoinCoin
committed
fix(dev): remove host configuration
Hosts configuration files might not only be used for mcp configurations. Hence, the remove operation might must not delete the file altogether, but simply clear the mcp field. - Replace the `unlink()` call by the creation of an empty `HostConfiguration` and write it to the host configuration file.
1 parent ce6ecc6 commit 6c5bc07

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

hatch/mcp_host_config/host_management.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,10 @@ def remove_host_configuration(self, hostname: str, no_backup: bool = False) -> C
337337
if backup_result.success:
338338
backup_path = backup_result.backup_path
339339

340-
# Remove configuration file
341-
config_path.unlink()
340+
# Remove configuration
341+
# Create Empty HostConfiguration
342+
empty_config = HostConfiguration()
343+
strategy.write_configuration(empty_config, no_backup=no_backup)
342344

343345
return ConfigurationResult(
344346
success=True,

0 commit comments

Comments
 (0)