prevent creating a bkp offering of a bkp repo that already exists

This commit is contained in:
Pearl Dsilva 2026-02-26 08:05:57 -05:00
parent d5138ed019
commit d53591c3fe
1 changed files with 4 additions and 4 deletions

View File

@ -358,11 +358,11 @@ public class BackupManagerImpl extends ManagerBase implements BackupManager {
if (!provider.isValidProviderOffering(zoneId, externalId)) {
throw new CloudRuntimeException("Backup offering '" + externalId + "' does not exist on provider " + provider.getName() + " on zone " + zoneId);
}
}
final BackupOffering existingOffering = backupOfferingDao.findByExternalId(externalId, zoneId);
if (existingOffering != null) {
throw new CloudRuntimeException("A backup offering with external ID '" + externalId + "' already exists in this zone");
}
final BackupOffering existingOffering = backupOfferingDao.findByExternalId(externalId, zoneId);
if (existingOffering != null) {
throw new CloudRuntimeException("A backup offering with external ID '" + externalId + "' already exists in this zone");
}
final BackupOfferingVO clonedOffering = new BackupOfferingVO(