Skip to content

Commit d53591c

Browse files
committed
prevent creating a bkp offering of a bkp repo that already exists
1 parent d5138ed commit d53591c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,11 @@ public BackupOffering cloneBackupOffering(final CloneBackupOfferingCmd cmd) {
358358
if (!provider.isValidProviderOffering(zoneId, externalId)) {
359359
throw new CloudRuntimeException("Backup offering '" + externalId + "' does not exist on provider " + provider.getName() + " on zone " + zoneId);
360360
}
361+
}
361362

362-
final BackupOffering existingOffering = backupOfferingDao.findByExternalId(externalId, zoneId);
363-
if (existingOffering != null) {
364-
throw new CloudRuntimeException("A backup offering with external ID '" + externalId + "' already exists in this zone");
365-
}
363+
final BackupOffering existingOffering = backupOfferingDao.findByExternalId(externalId, zoneId);
364+
if (existingOffering != null) {
365+
throw new CloudRuntimeException("A backup offering with external ID '" + externalId + "' already exists in this zone");
366366
}
367367

368368
final BackupOfferingVO clonedOffering = new BackupOfferingVO(

0 commit comments

Comments
 (0)