You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by fr...@apache.org on 2013/07/18 20:35:00 UTC

[1/2] git commit: updated refs/heads/master to d7781c3

Updated Branches:
  refs/heads/master 7e087645c -> d7781c3e3


CLOUDSTACK-3307
UCS:DB: Same UCS manager can be added multiple times

fixed resolved


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

Branch: refs/heads/master
Commit: d7781c3e37895573d470b8e06ca9220b48d2f00b
Parents: ed6164f
Author: frank <fr...@citrix.com>
Authored: Thu Jul 18 11:43:24 2013 -0700
Committer: frank <fr...@citrix.com>
Committed: Thu Jul 18 11:44:32 2013 -0700

----------------------------------------------------------------------
 .../ucs/src/com/cloud/ucs/manager/UcsManagerImpl.java     | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d7781c3e/plugins/hypervisors/ucs/src/com/cloud/ucs/manager/UcsManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/ucs/src/com/cloud/ucs/manager/UcsManagerImpl.java b/plugins/hypervisors/ucs/src/com/cloud/ucs/manager/UcsManagerImpl.java
index 150e3dc..e2bd31d 100755
--- a/plugins/hypervisors/ucs/src/com/cloud/ucs/manager/UcsManagerImpl.java
+++ b/plugins/hypervisors/ucs/src/com/cloud/ucs/manager/UcsManagerImpl.java
@@ -132,7 +132,14 @@ public class UcsManagerImpl implements UcsManager {
 
     @Override
     @DB
-    public UcsManagerResponse addUcsManager(AddUcsManagerCmd cmd) {
+    public UcsManagerResponse addUcsManager(AddUcsManagerCmd cmd) {
+    	SearchCriteriaService<UcsManagerVO, UcsManagerVO> q = SearchCriteria2.create(UcsManagerVO.class);
+    	q.addAnd(q.getEntity().getUrl(), Op.EQ, cmd.getUrl());
+    	UcsManagerVO mgrvo = q.find();
+    	if (mgrvo != null) {
+    	    throw new IllegalArgumentException(String.format("duplicate UCS manager. url[%s] is used by another UCS manager already", cmd.getUrl()));
+    	}
+    	 
         UcsManagerVO vo = new UcsManagerVO();
         vo.setUuid(UUID.randomUUID().toString());
         vo.setPassword(cmd.getPassword());
@@ -141,6 +148,7 @@ public class UcsManagerImpl implements UcsManager {
         vo.setZoneId(cmd.getZoneId());
         vo.setName(cmd.getName());
 
+
         Transaction txn = Transaction.currentTxn();
         txn.start();
         ucsDao.persist(vo);


[2/2] git commit: updated refs/heads/master to d7781c3

Posted by fr...@apache.org.
CLOUDSTACK-3428
UCS:API: We need listUCSManager API to lists all UCS managers registered with CloudStack

fixed resolved


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

Branch: refs/heads/master
Commit: ed6164fe003e2fb04662d5010969a73df5c2df8c
Parents: 7e08764
Author: frank <fr...@citrix.com>
Authored: Thu Jul 18 11:05:27 2013 -0700
Committer: frank <fr...@citrix.com>
Committed: Thu Jul 18 11:44:32 2013 -0700

----------------------------------------------------------------------
 .../ucs/src/org/apache/cloudstack/api/ListUcsManagerCmd.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ed6164fe/plugins/hypervisors/ucs/src/org/apache/cloudstack/api/ListUcsManagerCmd.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/ucs/src/org/apache/cloudstack/api/ListUcsManagerCmd.java b/plugins/hypervisors/ucs/src/org/apache/cloudstack/api/ListUcsManagerCmd.java
index e9b6644..4d4473d 100755
--- a/plugins/hypervisors/ucs/src/org/apache/cloudstack/api/ListUcsManagerCmd.java
+++ b/plugins/hypervisors/ucs/src/org/apache/cloudstack/api/ListUcsManagerCmd.java
@@ -46,7 +46,7 @@ import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.server.ManagementService;
 import com.cloud.ucs.manager.UcsManager;
 import com.cloud.user.Account;
-@APICommand(description="List ucs manager", responseObject=UcsManagerResponse.class)
+@APICommand(name="listUcsManager", description="List ucs manager", responseObject=UcsManagerResponse.class)
 public class ListUcsManagerCmd extends BaseListCmd {
     public static final Logger s_logger = Logger.getLogger(ListUcsManagerCmd.class);