Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -946,13 +946,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 @@ -1127,7 +1127,7 @@ public void scheduleBackups() {
continue;
}

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

Expand Down Expand Up @@ -1236,12 +1236,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