cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject git commit: updated refs/heads/master to fead670
Date Thu, 26 Dec 2013 21:00:26 GMT
Updated Branches:
  refs/heads/master 5d262d7b5 -> fead6706f


CLOUDSTACK-5530 attempt to add secondary storage with the same name is ignored


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/fead6706
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/fead6706
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/fead6706

Branch: refs/heads/master
Commit: fead6706ff25f42b6185aa2c41856778f639cc76
Parents: 5d262d7
Author: Bharat Kumar <bharat.kumar@citrix.com>
Authored: Thu Dec 26 15:30:30 2013 +0530
Committer: Min Chen <min.chen@citrix.com>
Committed: Thu Dec 26 12:43:44 2013 -0800

----------------------------------------------------------------------
 server/src/com/cloud/storage/StorageManagerImpl.java | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fead6706/server/src/com/cloud/storage/StorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java
index c7503b9..d73b2cc 100755
--- a/server/src/com/cloud/storage/StorageManagerImpl.java
+++ b/server/src/com/cloud/storage/StorageManagerImpl.java
@@ -1653,6 +1653,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);


Mime
View raw message