File tree Expand file tree Collapse file tree
server/src/com/cloud/storage Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1689,6 +1689,15 @@ public ImageStore discoverImageStore(AddImageStoreCmd cmd) throws IllegalArgumen
16891689 scopeType = ScopeType .REGION ;
16901690 }
16911691
1692+ String name = cmd .getName ();
1693+ if (name == null ) {
1694+ name = cmd .getUrl ();
1695+ }
1696+ ImageStoreVO imageStore = _imageStoreDao .findByName (name );
1697+ if (imageStore != null ) {
1698+ throw new InvalidParameterValueException ("The image store with name " + name + " already exists, try creating with another name" );
1699+ }
1700+
16921701 // check if scope is supported by store provider
16931702 if (!((ImageStoreProvider ) storeProvider ).isScopeSupported (scopeType )) {
16941703 throw new InvalidParameterValueException ("Image store provider " + providerName + " does not support scope " + scopeType );
You can’t perform that action at this time.
0 commit comments