Skip to content

Commit b0b037f

Browse files
Update backup.framework.enabled config to Global scope
1 parent 870a931 commit b0b037f

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

api/src/main/java/org/apache/cloudstack/backup/BackupManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public interface BackupManager extends BackupService, Configurable, PluggableSer
4040
ConfigKey<Boolean> BackupFrameworkEnabled = new ConfigKey<>("Advanced", Boolean.class,
4141
"backup.framework.enabled",
4242
"false",
43-
"Is backup and recovery framework enabled.", false, ConfigKey.Scope.Zone);
43+
"Is backup and recovery framework enabled.", false);
4444

4545
ConfigKey<String> BackupProviderPlugin = new ConfigKey<>("Advanced", String.class,
4646
"backup.framework.provider.plugin",

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

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -946,13 +946,13 @@ public boolean configure(String name, Map<String, Object> params) throws Configu
946946
return true;
947947
}
948948

949-
public boolean isDisabled(final Long zoneId) {
950-
return !(BackupFrameworkEnabled.valueIn(zoneId));
949+
public boolean isDisabled() {
950+
return !(BackupFrameworkEnabled.value());
951951
}
952952

953953
private void validateForZone(final Long zoneId) {
954-
if (zoneId == null || isDisabled(zoneId)) {
955-
throw new CloudRuntimeException("Backup and Recovery feature is disabled for the zone");
954+
if (zoneId == null || isDisabled()) {
955+
throw new CloudRuntimeException("Backup and Recovery feature is disabled");
956956
}
957957
}
958958

@@ -1127,7 +1127,7 @@ public void scheduleBackups() {
11271127
continue;
11281128
}
11291129

1130-
if (isDisabled(vm.getDataCenterId())) {
1130+
if (isDisabled()) {
11311131
continue;
11321132
}
11331133

@@ -1236,12 +1236,11 @@ protected void runInContext() {
12361236
if (logger.isTraceEnabled()) {
12371237
logger.trace("Backup sync background task is running...");
12381238
}
1239+
if (isDisabled()) {
1240+
logger.debug("Backup Sync Task is not enabled. Skipping!");
1241+
return;
1242+
}
12391243
for (final DataCenter dataCenter : dataCenterDao.listAllZones()) {
1240-
if (dataCenter == null || isDisabled(dataCenter.getId())) {
1241-
logger.debug("Backup Sync Task is not enabled in zone [{}]. Skipping this zone!", dataCenter == null ? "NULL Zone!" : dataCenter);
1242-
continue;
1243-
}
1244-
12451244
final BackupProvider backupProvider = getBackupProvider(dataCenter.getId());
12461245
if (backupProvider == null) {
12471246
logger.warn("Backup provider not available or configured for zone {}", dataCenter);

0 commit comments

Comments
 (0)