Fix p4tenant remove to support deleting individual VMs#4
Merged
Conversation
The p4tenant remove command incorrectly removed all VMs or the wrong VM when trying to remove a specific VM (e.g., restvm-mspina-02). Changes: - Updated TenantManager.remove_tenant() to accept optional vm_names parameter - The method now removes only the specified VMs instead of defaulting to VM-01 - Only removes user from restart_users when ALL their VMs are being deleted - Updated CLI to pass selected VMs to remove_tenant() - Fixed admin inventory updates to process each selected VM This allows users to selectively delete individual VMs while keeping others, matching the behavior of the "add vm" command. Fixes #1 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1 - The p4tenant remove command now correctly supports deleting individual VMs instead of removing all VMs or the wrong VM.
Problem
When trying to remove
restvm-mspina-02, the tool would:mspinafrom restart_usersrestvm-mspina-01from configuration filesSolution
Updated
TenantManager.remove_tenant()to accept an optionalvm_namesparameterrestart_userswhen ALL their VMs are being deletedUpdated CLI
removecommand to pass selected VMs to the methodChanges to apply
The "Changes to apply" UI now correctly shows:
Test plan
restvm-mspina-02while keeping-01)restart_userswhen some VMs remainrestart_users🤖 Generated with Claude Code