Changes to the error message displayed during the removal of public templates that are used#12373
Open
erikbocks wants to merge 1 commit intoapache:4.20from
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.20 #12373 +/- ##
=========================================
Coverage 16.26% 16.26%
- Complexity 13428 13431 +3
=========================================
Files 5660 5660
Lines 499959 499962 +3
Branches 60707 60708 +1
=========================================
+ Hits 81326 81339 +13
+ Misses 409560 409548 -12
- Partials 9073 9075 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
vishesh92
reviewed
Jan 6, 2026
server/src/main/java/com/cloud/template/TemplateManagerImpl.java
Outdated
Show resolved
Hide resolved
Member
|
@erikbocks could you target 4.20 as this is a simple enhancement? |
…emplates that are used
b50eca4 to
73a254a
Compare
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
73a254a to
f9e815e
Compare
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.
Description
During the removal of public templates, if it is being used by VMs, an error message is displayed informing that the removal could not proceed because it is being used by VMs, and the list of VMs using it is returned. However, sometimes the user that is trying to remove the template does not have access to these resources. Thus, the error message was changed, in order to return the list of VMs only to users with
RootAdminaccounts and for the others users, the message only states that the template is being used by VMs.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Screenshots (if appropriate):
Exception message for
Usertype accountsException message for
Root Admintype accountsHow Has This Been Tested?
First, two
Usertype accounts were created:templateAccandinstanceAcc. ThetemplateAccaccount was accessed and a public template was registered. After that, theinstanceAccwas accessed and a VM was deployed using the template registered bytemplateAcc.Logged in as
templateAccagain, I tried to remove the registered template, and it was possible to validate that the error message was displayed without the VMs list. By logging in with aRoot Adminaccount, it was possible to validate that the error message contained the VMs lists. Through the Management Server's logs it was also possible to validate that the log message displayed the VMs list:Updated log message