Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public interface BackupManager extends BackupService, Configurable, PluggableSer
ConfigKey<Boolean> BackupFrameworkEnabled = new ConfigKey<>("Advanced", Boolean.class,
"backup.framework.enabled",
"false",
"Is backup and recovery framework enabled.", false, ConfigKey.Scope.Zone);
"Is backup and recovery framework enabled.", false);

ConfigKey<String> BackupProviderPlugin = new ConfigKey<>("Advanced", String.class,
"backup.framework.provider.plugin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -947,13 +947,13 @@ public boolean configure(String name, Map<String, Object> params) throws Configu
return true;
}

public boolean isDisabled(final Long zoneId) {
return !(BackupFrameworkEnabled.value() && BackupFrameworkEnabled.valueIn(zoneId));
public boolean isDisabled() {
return !(BackupFrameworkEnabled.value());
}

private void validateForZone(final Long zoneId) {
if (zoneId == null || isDisabled(zoneId)) {
throw new CloudRuntimeException("Backup and Recovery feature is disabled for the zone");
if (zoneId == null || isDisabled()) {
throw new CloudRuntimeException("Backup and Recovery feature is disabled");
}
}

Expand Down Expand Up @@ -1128,7 +1128,7 @@ public void scheduleBackups() {
continue;
}

if (isDisabled(vm.getDataCenterId())) {
if (isDisabled()) {
continue;
}

Expand Down Expand Up @@ -1237,12 +1237,11 @@ protected void runInContext() {
if (logger.isTraceEnabled()) {
logger.trace("Backup sync background task is running...");
}
if (isDisabled()) {
logger.debug("Backup Sync Task is not enabled. Skipping!");
return;
}
for (final DataCenter dataCenter : dataCenterDao.listAllZones()) {
if (dataCenter == null || isDisabled(dataCenter.getId())) {
logger.debug("Backup Sync Task is not enabled in zone [{}]. Skipping this zone!", dataCenter == null ? "NULL Zone!" : dataCenter);
continue;
}

final BackupProvider backupProvider = getBackupProvider(dataCenter.getId());
if (backupProvider == null) {
logger.warn("Backup provider not available or configured for zone {}", dataCenter);
Expand Down
Loading