Skip to content

Commit 9937c26

Browse files
committed
Don't show backup storage in list_capacity for dummy plugin or if backup_framework is disabled
1 parent f2d6356 commit 9937c26

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

plugins/backup/dummy/src/main/java/org/apache/cloudstack/backup/DummyBackupProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public boolean supportsInstanceFromBackup() {
191191

192192
@Override
193193
public Pair<Long, Long> getBackupStorageStats(Long zoneId) {
194-
return new Pair<>(8L * 1024 * 1024 * 1024, 10L * 1024 * 1024 * 1024);
194+
return new Pair<>(0L, 0L);
195195
}
196196

197197
@Override

server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2161,6 +2161,9 @@ public BackupResponse createBackupResponse(Backup backup, Boolean listVmDetails)
21612161

21622162
@Override
21632163
public CapacityVO getBackupStorageUsedStats(Long zoneId) {
2164+
if (isDisabled(zoneId)) {
2165+
return new CapacityVO(null, zoneId, null, null, 0L, 0L, Capacity.CAPACITY_TYPE_BACKUP_STORAGE);
2166+
}
21642167
final BackupProvider backupProvider = getBackupProvider(zoneId);
21652168
Pair<Long, Long> backupUsage = backupProvider.getBackupStorageStats(zoneId);
21662169
return new CapacityVO(null, zoneId, null, null, backupUsage.first(), backupUsage.second(), Capacity.CAPACITY_TYPE_BACKUP_STORAGE);

0 commit comments

Comments
 (0)