yigitbasalma commented on code in PR #13332:
URL: https://github.com/apache/cloudstack/pull/13332#discussion_r3550602600


##########
server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java:
##########
@@ -1822,12 +1822,9 @@ public BackupProvider getBackupProvider(final Long 
zoneId) {
     }
 
     public BackupProvider getBackupProvider(final String name) {
-       if (StringUtils.isEmpty(name)) {
-           throw new CloudRuntimeException("Invalid backup provider name 
provided");
-       }
-       if (!backupProvidersMap.containsKey(name)) {
-           throw new CloudRuntimeException("Failed to find backup provider by 
the name: " + name);
-       }

Review Comment:
   You're right, those checks are fine and serve an important purpose for all 
the other callers of getBackupProvider(). I've reverted that change and instead 
added a try-catch in getBackupStorageUsedStats() specifically — this is the 
only place where a missing provider should be handled gracefully rather than 
propagating an exception, since it feeds the capacity dashboard.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to