Changes to the error message displayed during the removal of public templates that are used #12373
+9
−3
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