Skip to content

Commit a2179dc

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

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
@@ -350,11 +350,11 @@ public BackupOffering cloneBackupOffering(final CloneBackupOfferingCmd cmd) {
350350
if (!provider.isValidProviderOffering(zoneId, externalId)) {
351351
throw new CloudRuntimeException("Backup offering '" + externalId + "' does not exist on provider " + provider.getName() + " on zone " + zoneId);
352352
}
353+
}
353354

354-
final BackupOffering existingOffering = backupOfferingDao.findByExternalId(externalId, zoneId);
355-
if (existingOffering != null) {
356-
throw new CloudRuntimeException("A backup offering with external ID '" + externalId + "' already exists in this zone");
357-
}
355+
final BackupOffering existingOffering = backupOfferingDao.findByExternalId(externalId, zoneId);
356+
if (existingOffering != null) {
357+
throw new CloudRuntimeException("A backup offering with external ID '" + externalId + "' already exists in this zone");
358358
}
359359

360360
final BackupOfferingVO clonedOffering = new BackupOfferingVO(

0 commit comments

Comments
 (0)