mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-5530 attempt to add secondary storage with the same name is ignored
This commit is contained in:
parent
35ba14d88d
commit
69fb1d4ed0
|
|
@ -1689,6 +1689,15 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||
scopeType = ScopeType.REGION;
|
||||
}
|
||||
|
||||
String name = cmd.getName();
|
||||
if (name == null) {
|
||||
name = cmd.getUrl();
|
||||
}
|
||||
ImageStoreVO imageStore = _imageStoreDao.findByName(name);
|
||||
if (imageStore != null) {
|
||||
throw new InvalidParameterValueException("The image store with name " + name + " already exists, try creating with another name");
|
||||
}
|
||||
|
||||
// check if scope is supported by store provider
|
||||
if (!((ImageStoreProvider) storeProvider).isScopeSupported(scopeType)) {
|
||||
throw new InvalidParameterValueException("Image store provider " + providerName + " does not support scope " + scopeType);
|
||||
|
|
|
|||
Loading…
Reference in New Issue