@@ -946,13 +946,13 @@ public boolean configure(String name, Map<String, Object> params) throws Configu
946946 return true ;
947947 }
948948
949- public boolean isDisabled () {
950- return !(BackupFrameworkEnabled .value ( ));
949+ public boolean isDisabled (final Long zoneId ) {
950+ return !(BackupFrameworkEnabled .valueIn ( zoneId ));
951951 }
952952
953953 private void validateForZone (final Long zoneId ) {
954- if (zoneId == null || isDisabled ()) {
955- throw new CloudRuntimeException ("Backup and Recovery feature is disabled" );
954+ if (zoneId == null || isDisabled (zoneId )) {
955+ throw new CloudRuntimeException ("Backup and Recovery feature is disabled for the zone " );
956956 }
957957 }
958958
@@ -1127,7 +1127,7 @@ public void scheduleBackups() {
11271127 continue ;
11281128 }
11291129
1130- if (isDisabled ()) {
1130+ if (isDisabled (vm . getDataCenterId () )) {
11311131 continue ;
11321132 }
11331133
@@ -1236,11 +1236,12 @@ 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- }
12431239 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+
12441245 final BackupProvider backupProvider = getBackupProvider (dataCenter .getId ());
12451246 if (backupProvider == null ) {
12461247 logger .warn ("Backup provider not available or configured for zone {}" , dataCenter );
0 commit comments