CLOUDSTACK-2069: Anti-Affinity - listVirtualmachines - affinitygroup entity 
does not include other Vms that are part of this affinity group.

Removed the virtualmachineIds:[] sent in the API response.
The listVirtualMachines Resopnse need not list details beyond the id, 
name,description etc.
If the user wants to get the list of VMs in the group, listAffinityGroups APi 
can be used.


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

Branch: refs/heads/marvin_refactor
Commit: 3a9c63d8c919deaaea12d40f83272af3162e84d6
Parents: 6dccf63
Author: Prachi Damle <[email protected]>
Authored: Wed Apr 17 17:48:52 2013 -0700
Committer: Prachi Damle <[email protected]>
Committed: Wed Apr 17 18:04:15 2013 -0700

----------------------------------------------------------------------
 .../cloudstack/affinity/AffinityGroupResponse.java |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3a9c63d8/api/src/org/apache/cloudstack/affinity/AffinityGroupResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/affinity/AffinityGroupResponse.java 
b/api/src/org/apache/cloudstack/affinity/AffinityGroupResponse.java
index afd33da..b6d4ff6 100644
--- a/api/src/org/apache/cloudstack/affinity/AffinityGroupResponse.java
+++ b/api/src/org/apache/cloudstack/affinity/AffinityGroupResponse.java
@@ -64,7 +64,6 @@ public class AffinityGroupResponse extends BaseResponse 
implements ControlledVie
     private List<String> vmIdList;
 
     public AffinityGroupResponse() {
-        this.vmIdList = new ArrayList<String>();
     }
 
     @Override
@@ -149,6 +148,10 @@ public class AffinityGroupResponse extends BaseResponse 
implements ControlledVie
     }
 
     public void addVMId(String vmId) {
+        if (this.vmIdList == null) {
+            this.vmIdList = new ArrayList<String>();
+        }
+
         this.vmIdList.add(vmId);
     }
 

Reply via email to