[1/2] git commit: updated refs/heads/4.3-forward to 2513d6b

2014-02-03 Thread dahn
Updated Branches:
  refs/heads/4.3-forward 92abb9439 -> 2513d6b91


Revert "findbugs replaced byte[].toString() with Arrays.toString(byte[])(cherry 
picked from commit ce7c6d23575d455a8273b77702a56b7bb419b37b)"

This reverts commit 55ec8f3a2d8ae73ae1e20a806a8f8d0ee29fa274.


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

Branch: refs/heads/4.3-forward
Commit: 8e96111c5512e67b4fca2315bb73ed457791ce18
Parents: 92abb94
Author: Daan Hoogland 
Authored: Mon Feb 3 10:47:19 2014 +0100
Committer: Daan Hoogland 
Committed: Mon Feb 3 10:47:19 2014 +0100

--
 .../api/command/LdapCreateAccountCmd.java  |  3 +--
 .../cloudstack/api/command/LdapImportUsersCmd.java | 17 +++--
 2 files changed, 4 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8e96111c/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapCreateAccountCmd.java
--
diff --git 
a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapCreateAccountCmd.java
 
b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapCreateAccountCmd.java
index 3afa22b..981e72e 100644
--- 
a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapCreateAccountCmd.java
+++ 
b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapCreateAccountCmd.java
@@ -18,7 +18,6 @@ package org.apache.cloudstack.api.command;
 
 import java.security.NoSuchAlgorithmException;
 import java.security.SecureRandom;
-import java.util.Arrays;
 import java.util.Map;
 
 import javax.inject.Inject;
@@ -126,7 +125,7 @@ public class LdapCreateAccountCmd extends BaseCmd {
final SecureRandom randomGen = 
SecureRandom.getInstance("SHA1PRNG");
final byte bytes[] = new byte[20];
randomGen.nextBytes(bytes);
-return Arrays.toString(Base64.encode(bytes));
+   return Base64.encode(bytes).toString();
} catch (final NoSuchAlgorithmException e) {
throw new 
ServerApiException(ApiErrorCode.INTERNAL_ERROR,
"Failed to generate random password");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8e96111c/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapImportUsersCmd.java
--
diff --git 
a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapImportUsersCmd.java
 
b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapImportUsersCmd.java
index 41eacf0..1855d5d 100644
--- 
a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapImportUsersCmd.java
+++ 
b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapImportUsersCmd.java
@@ -19,19 +19,13 @@ package org.apache.cloudstack.api.command;
 import java.security.NoSuchAlgorithmException;
 import java.security.SecureRandom;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
 import javax.inject.Inject;
 
-import org.apache.cloudstack.api.APICommand;
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.ApiErrorCode;
-import org.apache.cloudstack.api.BaseListCmd;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.*;
 import org.apache.cloudstack.api.response.DomainResponse;
 import org.apache.cloudstack.api.response.LdapUserResponse;
 import org.apache.cloudstack.api.response.ListResponse;
@@ -43,12 +37,7 @@ import org.apache.log4j.Logger;
 import org.bouncycastle.util.encoders.Base64;
 
 import com.cloud.domain.Domain;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.exception.NetworkRuleConflictException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.exception.*;
 import com.cloud.user.AccountService;
 import com.cloud.user.DomainService;
 
@@ -186,7 +175,7 @@ public class LdapImportUsersCmd extends BaseListCmd {
 final SecureRandom randomGen = 
SecureRandom.getInstance("SHA1PRNG");
 final byte bytes[] = new byte[20];
 randomGen.nextBytes(bytes);
-return Arrays.toStri

[2/2] git commit: updated refs/heads/4.3-forward to 2513d6b

2014-02-03 Thread dahn
findbugs replaced byte[].toString() with new String(byte[])

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

Branch: refs/heads/4.3-forward
Commit: 2513d6b91e29356e131e96eca5e00ed09894
Parents: 8e96111
Author: Daan Hoogland 
Authored: Sun Feb 2 19:50:58 2014 +0100
Committer: Daan Hoogland 
Committed: Mon Feb 3 10:48:10 2014 +0100

--
 .../org/apache/cloudstack/api/command/LdapCreateAccountCmd.java| 2 +-
 .../src/org/apache/cloudstack/api/command/LdapImportUsersCmd.java  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2513d6b9/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapCreateAccountCmd.java
--
diff --git 
a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapCreateAccountCmd.java
 
b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapCreateAccountCmd.java
index 981e72e..0878410 100644
--- 
a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapCreateAccountCmd.java
+++ 
b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapCreateAccountCmd.java
@@ -125,7 +125,7 @@ public class LdapCreateAccountCmd extends BaseCmd {
final SecureRandom randomGen = 
SecureRandom.getInstance("SHA1PRNG");
final byte bytes[] = new byte[20];
randomGen.nextBytes(bytes);
-   return Base64.encode(bytes).toString();
+   return new String(Base64.encode(bytes));
} catch (final NoSuchAlgorithmException e) {
throw new 
ServerApiException(ApiErrorCode.INTERNAL_ERROR,
"Failed to generate random password");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2513d6b9/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapImportUsersCmd.java
--
diff --git 
a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapImportUsersCmd.java
 
b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapImportUsersCmd.java
index 1855d5d..5e724e8 100644
--- 
a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapImportUsersCmd.java
+++ 
b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapImportUsersCmd.java
@@ -175,7 +175,7 @@ public class LdapImportUsersCmd extends BaseListCmd {
 final SecureRandom randomGen = 
SecureRandom.getInstance("SHA1PRNG");
 final byte bytes[] = new byte[20];
 randomGen.nextBytes(bytes);
-return Base64.encode(bytes).toString();
+return new String(Base64.encode(bytes));
 } catch (final NoSuchAlgorithmException e) {
 throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed 
to generate random password");
 }



git commit: kvm: It's no longer required to have VNC listen in 0.0.0.0

2014-02-03 Thread widodh
Updated Branches:
  refs/heads/master 4ae5cb519 -> 4f17c0bf0


kvm: It's no longer required to have VNC listen in 0.0.0.0

In both the master and 4.3 branch there is a patch which sets
the VNC address to the private IP of the hypervisor and during
migration this will be changed to the private IP of the destination
hypervisor.

Binding VNC on 0.0.0.0 is a potential security issue with the hypervisors
also have a public IP address and the VNC ports are not firewalled.


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

Branch: refs/heads/master
Commit: 4f17c0bf02bfe292972bf631387c1e37c5e9995d
Parents: 4ae5cb5
Author: Wido den Hollander 
Authored: Mon Feb 3 12:37:17 2014 +0100
Committer: Wido den Hollander 
Committed: Mon Feb 3 12:37:17 2014 +0100

--
 en-US/hypervisor-host-install-libvirt.xml | 5 -
 1 file changed, 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack-docs/blob/4f17c0bf/en-US/hypervisor-host-install-libvirt.xml
--
diff --git a/en-US/hypervisor-host-install-libvirt.xml 
b/en-US/hypervisor-host-install-libvirt.xml
index c4be67e..d3d6b9b 100644
--- a/en-US/hypervisor-host-install-libvirt.xml
+++ b/en-US/hypervisor-host-install-libvirt.xml
@@ -47,11 +47,6 @@
 libvirtd_opts="-d -l"
 
 
-In order to have the VNC Console work we have to make sure 
it will bind on 0.0.0.0. We do this by editing 
/etc/libvirt/qemu.conf
-Make sure this parameter is set:
-vnc_listen = "0.0.0.0"
-
-
 Restart libvirt
 In RHEL or CentOS:
 $ service libvirtd 
restart



git commit: updated refs/heads/master to f4a96d4

2014-02-03 Thread likithas
Updated Branches:
  refs/heads/master 9cb37ec34 -> f4a96d4c8


CLOUDSTACK-6011 . When detach is called on a deleted volume, avoid the NPE and 
throw an appropriate exception instead


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

Branch: refs/heads/master
Commit: f4a96d4c853bd4f60539b9b9e9218b42640652a9
Parents: 9cb37ec
Author: Likitha Shetty 
Authored: Mon Feb 3 17:59:58 2014 +0530
Committer: Likitha Shetty 
Committed: Mon Feb 3 18:17:25 2014 +0530

--
 server/src/com/cloud/storage/VolumeApiServiceImpl.java | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f4a96d4c/server/src/com/cloud/storage/VolumeApiServiceImpl.java
--
diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java 
b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
index c856379..6955825 100644
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@ -1382,6 +1382,11 @@ public class VolumeApiServiceImpl extends ManagerBase 
implements VolumeApiServic
 volume = 
_volsDao.findByInstanceAndDeviceId(cmmd.getVirtualMachineId(), 
cmmd.getDeviceId()).get(0);
 }
 
+// Check that the volume ID is valid
+if (volume == null) {
+throw new InvalidParameterValueException("Unable to find volume 
with ID: " + volumeId);
+}
+
 Long vmId = null;
 
 if (cmmd.getVirtualMachineId() == null) {
@@ -1390,11 +1395,6 @@ public class VolumeApiServiceImpl extends ManagerBase 
implements VolumeApiServic
 vmId = cmmd.getVirtualMachineId();
 }
 
-// Check that the volume ID is valid
-if (volume == null) {
-throw new InvalidParameterValueException("Unable to find volume 
with ID: " + volumeId);
-}
-
 // Permissions check
 _accountMgr.checkAccess(caller, null, true, volume);
 



git commit: updated refs/heads/master to 5ae12f3

2014-02-03 Thread widodh
Updated Branches:
  refs/heads/master f4a96d4c8 -> 5ae12f31b


rbd: Set client timeout to 30 seconds.

By default the client_mount_timeout setting in librados is 300 seconds,
but that causes the connect to the Ceph cluster to block for 5 minutes
if the Ceph cluster is not available.

This patch is not ideal, but it mitigates the problem for now.

At a later point all this librados/librbd code should go back to libvirt
again, but the current versions of libvirt in the distributions are
to old for all the features we require.

For now this should prevent the CloudStack agent blocking for 5 minutes
when the Ceph cluster isn't available.

This is also tracked at the Ceph tracker: http://tracker.ceph.com/issues/6507


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

Branch: refs/heads/master
Commit: 5ae12f31b7ab87c28759bc37a0b1df4ffd0db0b0
Parents: f4a96d4
Author: Wido den Hollander 
Authored: Mon Feb 3 12:11:27 2014 +0100
Committer: Wido den Hollander 
Committed: Mon Feb 3 16:07:00 2014 +0100

--
 .../hypervisor/kvm/resource/LibvirtComputingResource.java  | 3 +++
 .../com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java  | 2 ++
 .../cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java| 6 ++
 3 files changed, 11 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5ae12f31/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
--
diff --git 
a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
 
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index fd0078c..19a75d2 100755
--- 
a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ 
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -1785,6 +1785,7 @@ public class LibvirtComputingResource extends 
ServerResourceBase implements Serv
 Rados r = new Rados(pool.getAuthUserName());
 r.confSet("mon_host", pool.getSourceHost() + ":" + 
pool.getSourcePort());
 r.confSet("key", pool.getAuthSecret());
+r.confSet("client_mount_timeout", "30");
 r.connect();
 s_logger.debug("Succesfully connected to Ceph cluster at " 
+ r.confGet("mon_host"));
 
@@ -2234,6 +2235,7 @@ public class LibvirtComputingResource extends 
ServerResourceBase implements Serv
 Rados r = new Rados(primaryPool.getAuthUserName());
 r.confSet("mon_host", primaryPool.getSourceHost() + 
":" + primaryPool.getSourcePort());
 r.confSet("key", primaryPool.getAuthSecret());
+r.confSet("client_mount_timeout", "30");
 r.connect();
 s_logger.debug("Succesfully connected to Ceph cluster 
at " + r.confGet("mon_host"));
 
@@ -2316,6 +2318,7 @@ public class LibvirtComputingResource extends 
ServerResourceBase implements Serv
 Rados r = new Rados(primaryPool.getAuthUserName());
 r.confSet("mon_host", primaryPool.getSourceHost() + ":" + 
primaryPool.getSourcePort());
 r.confSet("key", primaryPool.getAuthSecret());
+r.confSet("client_mount_timeout", "30");
 r.connect();
 s_logger.debug("Succesfully connected to Ceph cluster at " 
+ r.confGet("mon_host"));
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5ae12f31/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
--
diff --git 
a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
 
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
index 7d5d335..8c3713f 100644
--- 
a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
+++ 
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
@@ -675,6 +675,7 @@ public class KVMStorageProcessor implements 
StorageProcessor {
 Rados r = new Rados(primaryPool.getAuthUserName());
 r.confSet("mon_host", primaryPool.getSourceHost() + ":" + 
primaryPool.getSourcePort());
 r.confSet("key", primaryPool.getAuthSecret());
+r.confSet("client_mount_timeout", "30");
 

git commit: updated refs/heads/master to 9778481

2014-02-03 Thread dahn
Updated Branches:
  refs/heads/master 5ae12f31b -> 9778481d8


findbugs: handling of long values and wrappers

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

Branch: refs/heads/master
Commit: 9778481d850fa98b62c770821b7c601684c21191
Parents: 5ae12f3
Author: Daan Hoogland 
Authored: Mon Feb 3 20:19:11 2014 +0100
Committer: Daan Hoogland 
Committed: Mon Feb 3 20:19:11 2014 +0100

--
 engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java | 2 +-
 .../orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9778481d/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java
--
diff --git a/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java 
b/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java
index 3c31301..3ebaf4a 100755
--- a/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java
+++ b/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java
@@ -130,7 +130,7 @@ public abstract class AgentAttache {
 _maintenance = maintenance;
 _requests = new LinkedList();
 _agentMgr = agentMgr;
-_nextSequence = s_rand.nextInt(Short.MAX_VALUE) << 48;
+_nextSequence = new Long(s_rand.nextInt(Short.MAX_VALUE)) << 48;
 _outstandingTaskCount = new AtomicInteger(0);
 }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9778481d/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
--
diff --git 
a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java 
b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
index f3e3c36..8b4433e 100755
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -4236,7 +4236,7 @@ public class VirtualMachineManagerImpl extends 
ManagerBase implements VirtualMac
 @Override
 public boolean checkCondition() {
 VMInstanceVO instance = _vmDao.findById(vmId);
-if (instance.getPowerState() == desiredPowerState && 
(srcHostIdForMigration != null && instance.getPowerHostId() != 
srcHostIdForMigration))
+if (instance.getPowerState() == desiredPowerState && 
(srcHostIdForMigration != null && 
srcHostIdForMigration.equals(instance.getPowerHostId(
 return true;
 return false;
 }



git commit: updated refs/heads/master to b35eb04

2014-02-03 Thread mchen
Updated Branches:
  refs/heads/master 9778481d8 -> b35eb04de


CLOUDSTACK-6017: NPE while creating snapshot multiple times on same Root
volume with S3 as secondary storage.

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

Branch: refs/heads/master
Commit: b35eb04de3fd26dbbb57124dd4da51c4ffd27486
Parents: 9778481
Author: Min Chen 
Authored: Mon Feb 3 12:16:19 2014 -0800
Committer: Min Chen 
Committed: Mon Feb 3 12:16:19 2014 -0800

--
 .../org/apache/cloudstack/storage/snapshot/SnapshotObject.java  | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b35eb04d/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
--
diff --git 
a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
 
b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
index 9cac20d..669a075 100644
--- 
a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
+++ 
b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
@@ -286,7 +286,10 @@ public class SnapshotObject implements SnapshotInfo {
 } else if (answer instanceof CopyCmdAnswer) {
 SnapshotObjectTO snapshotTO = 
(SnapshotObjectTO)((CopyCmdAnswer)answer).getNewData();
 snapshotStore.setInstallPath(snapshotTO.getPath());
-snapshotStore.setSize(snapshotTO.getPhysicalSize());
+if (snapshotTO.getPhysicalSize() != null) {
+// For S3 delta snapshot, physical size is currently not 
set
+snapshotStore.setSize(snapshotTO.getPhysicalSize());
+}
 if (snapshotTO.getParentSnapshotPath() == null) {
 snapshotStore.setParentSnapshotId(0L);
 }



git commit: updated refs/heads/4.3-forward to 4022543

2014-02-03 Thread mchen
Updated Branches:
  refs/heads/4.3-forward 2513d6b91 -> 402254337


CLOUDSTACK-6017: NPE while creating snapshot multiple times on same Root
volume with S3 as secondary storage.


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

Branch: refs/heads/4.3-forward
Commit: 402254337c8f29e5bdef4996953284d36043f8ea
Parents: 2513d6b
Author: Min Chen 
Authored: Mon Feb 3 12:16:19 2014 -0800
Committer: Min Chen 
Committed: Mon Feb 3 12:23:52 2014 -0800

--
 .../org/apache/cloudstack/storage/snapshot/SnapshotObject.java  | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/40225433/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
--
diff --git 
a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
 
b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
index 314ce8e..a69b2d7 100644
--- 
a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
+++ 
b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
@@ -288,7 +288,10 @@ public class SnapshotObject implements SnapshotInfo {
 } else if (answer instanceof CopyCmdAnswer) {
 SnapshotObjectTO snapshotTO = (SnapshotObjectTO) 
((CopyCmdAnswer) answer).getNewData();
 snapshotStore.setInstallPath(snapshotTO.getPath());
-snapshotStore.setSize(snapshotTO.getPhysicalSize());
+if (snapshotTO.getPhysicalSize() != null) {
+// For S3 delta snapshot, physical size is currently not 
set
+snapshotStore.setSize(snapshotTO.getPhysicalSize());
+}
 if (snapshotTO.getParentSnapshotPath() == null) {
 snapshotStore.setParentSnapshotId(0L);
 }



git commit: updated refs/heads/4.3 to 8f63c2c

2014-02-03 Thread animesh
Updated Branches:
  refs/heads/4.3 91ec548fc -> 8f63c2cf9


CLOUDSTACK-6017: NPE while creating snapshot multiple times on same Root
volume with S3 as secondary storage.
(cherry picked from commit 402254337c8f29e5bdef4996953284d36043f8ea)

Signed-off-by: Animesh Chaturvedi 


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

Branch: refs/heads/4.3
Commit: 8f63c2cf9c463373d774cb563e63fc56828e1418
Parents: 91ec548
Author: Min Chen 
Authored: Mon Feb 3 12:16:19 2014 -0800
Committer: Animesh Chaturvedi 
Committed: Mon Feb 3 14:05:20 2014 -0800

--
 .../org/apache/cloudstack/storage/snapshot/SnapshotObject.java  | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8f63c2cf/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
--
diff --git 
a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
 
b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
index 314ce8e..a69b2d7 100644
--- 
a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
+++ 
b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
@@ -288,7 +288,10 @@ public class SnapshotObject implements SnapshotInfo {
 } else if (answer instanceof CopyCmdAnswer) {
 SnapshotObjectTO snapshotTO = (SnapshotObjectTO) 
((CopyCmdAnswer) answer).getNewData();
 snapshotStore.setInstallPath(snapshotTO.getPath());
-snapshotStore.setSize(snapshotTO.getPhysicalSize());
+if (snapshotTO.getPhysicalSize() != null) {
+// For S3 delta snapshot, physical size is currently not 
set
+snapshotStore.setSize(snapshotTO.getPhysicalSize());
+}
 if (snapshotTO.getParentSnapshotPath() == null) {
 snapshotStore.setParentSnapshotId(0L);
 }



git commit: updated refs/heads/4.2 to 92d7c51

2014-02-03 Thread yasker
Updated Branches:
  refs/heads/4.2 a9a87f7c3 -> 92d7c518b


CLOUDSTACK-6018: Increase dnsmasq dhcp-lease-max to 2100

Would able to accomodate one /21 network then.


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

Branch: refs/heads/4.2
Commit: 92d7c518b4a4319fe5c9834054d1e565a793b4df
Parents: a9a87f7
Author: Sheng Yang 
Authored: Mon Feb 3 14:49:31 2014 -0800
Committer: Sheng Yang 
Committed: Mon Feb 3 14:50:44 2014 -0800

--
 patches/systemvm/debian/config/etc/dnsmasq.conf.tmpl | 2 +-
 patches/systemvm/debian/config/etc/vpcdnsmasq.conf   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/92d7c518/patches/systemvm/debian/config/etc/dnsmasq.conf.tmpl
--
diff --git a/patches/systemvm/debian/config/etc/dnsmasq.conf.tmpl 
b/patches/systemvm/debian/config/etc/dnsmasq.conf.tmpl
index a3e0bc8..07c5902 100644
--- a/patches/systemvm/debian/config/etc/dnsmasq.conf.tmpl
+++ b/patches/systemvm/debian/config/etc/dnsmasq.conf.tmpl
@@ -501,7 +501,7 @@ dhcp-option=vendor:MSFT,2,1i
 #dhcp-boot=/var/ftpd/pxelinux.0,boothost,tftp_server_name
 
 # Set the limit on DHCP leases, the default is 150
-#dhcp-lease-max=150
+dhcp-lease-max=2100
 
 # The DHCP server needs somewhere on disk to keep its lease database.
 # This defaults to a sane location, but if you want to change it, use

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/92d7c518/patches/systemvm/debian/config/etc/vpcdnsmasq.conf
--
diff --git a/patches/systemvm/debian/config/etc/vpcdnsmasq.conf 
b/patches/systemvm/debian/config/etc/vpcdnsmasq.conf
index 3622d0e..d46d623 100644
--- a/patches/systemvm/debian/config/etc/vpcdnsmasq.conf
+++ b/patches/systemvm/debian/config/etc/vpcdnsmasq.conf
@@ -334,7 +334,7 @@ dhcp-option=vendor:MSFT,2,1i
 #dhcp-boot=/var/ftpd/pxelinux.0,boothost,192.168.0.3
 
 # Set the limit on DHCP leases, the default is 150
-#dhcp-lease-max=150
+dhcp-lease-max=2100
 
 # The DHCP server needs somewhere on disk to keep its lease database.
 # This defaults to a sane location, but if you want to change it, use



git commit: updated refs/heads/4.3-forward to 50234ea

2014-02-03 Thread yasker
Updated Branches:
  refs/heads/4.3-forward 402254337 -> 50234ea72


CLOUDSTACK-6018: Increase dnsmasq dhcp-lease-max to 2100

Would able to accomodate one /21 network then.


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

Branch: refs/heads/4.3-forward
Commit: 50234ea72b29b3e192a3d80b8cb8d69e4309d141
Parents: 4022543
Author: Sheng Yang 
Authored: Mon Feb 3 14:49:31 2014 -0800
Committer: Sheng Yang 
Committed: Mon Feb 3 14:51:29 2014 -0800

--
 systemvm/patches/debian/config/etc/dnsmasq.conf.tmpl | 2 +-
 systemvm/patches/debian/config/etc/vpcdnsmasq.conf   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/50234ea7/systemvm/patches/debian/config/etc/dnsmasq.conf.tmpl
--
diff --git a/systemvm/patches/debian/config/etc/dnsmasq.conf.tmpl 
b/systemvm/patches/debian/config/etc/dnsmasq.conf.tmpl
index a3e0bc8..07c5902 100644
--- a/systemvm/patches/debian/config/etc/dnsmasq.conf.tmpl
+++ b/systemvm/patches/debian/config/etc/dnsmasq.conf.tmpl
@@ -501,7 +501,7 @@ dhcp-option=vendor:MSFT,2,1i
 #dhcp-boot=/var/ftpd/pxelinux.0,boothost,tftp_server_name
 
 # Set the limit on DHCP leases, the default is 150
-#dhcp-lease-max=150
+dhcp-lease-max=2100
 
 # The DHCP server needs somewhere on disk to keep its lease database.
 # This defaults to a sane location, but if you want to change it, use

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/50234ea7/systemvm/patches/debian/config/etc/vpcdnsmasq.conf
--
diff --git a/systemvm/patches/debian/config/etc/vpcdnsmasq.conf 
b/systemvm/patches/debian/config/etc/vpcdnsmasq.conf
index 3622d0e..d46d623 100644
--- a/systemvm/patches/debian/config/etc/vpcdnsmasq.conf
+++ b/systemvm/patches/debian/config/etc/vpcdnsmasq.conf
@@ -334,7 +334,7 @@ dhcp-option=vendor:MSFT,2,1i
 #dhcp-boot=/var/ftpd/pxelinux.0,boothost,192.168.0.3
 
 # Set the limit on DHCP leases, the default is 150
-#dhcp-lease-max=150
+dhcp-lease-max=2100
 
 # The DHCP server needs somewhere on disk to keep its lease database.
 # This defaults to a sane location, but if you want to change it, use



git commit: updated refs/heads/master to 66989a9

2014-02-03 Thread yasker
Updated Branches:
  refs/heads/master b35eb04de -> 66989a936


CLOUDSTACK-6018: Increase dnsmasq dhcp-lease-max to 2100

Would able to accomodate one /21 network then.


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

Branch: refs/heads/master
Commit: 66989a9364501b91f5c3a64388ce62cd3e83e2d4
Parents: b35eb04
Author: Sheng Yang 
Authored: Mon Feb 3 14:49:31 2014 -0800
Committer: Sheng Yang 
Committed: Mon Feb 3 14:52:42 2014 -0800

--
 systemvm/patches/debian/config/etc/dnsmasq.conf.tmpl | 2 +-
 systemvm/patches/debian/config/etc/vpcdnsmasq.conf   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/66989a93/systemvm/patches/debian/config/etc/dnsmasq.conf.tmpl
--
diff --git a/systemvm/patches/debian/config/etc/dnsmasq.conf.tmpl 
b/systemvm/patches/debian/config/etc/dnsmasq.conf.tmpl
index a3e0bc8..07c5902 100644
--- a/systemvm/patches/debian/config/etc/dnsmasq.conf.tmpl
+++ b/systemvm/patches/debian/config/etc/dnsmasq.conf.tmpl
@@ -501,7 +501,7 @@ dhcp-option=vendor:MSFT,2,1i
 #dhcp-boot=/var/ftpd/pxelinux.0,boothost,tftp_server_name
 
 # Set the limit on DHCP leases, the default is 150
-#dhcp-lease-max=150
+dhcp-lease-max=2100
 
 # The DHCP server needs somewhere on disk to keep its lease database.
 # This defaults to a sane location, but if you want to change it, use

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/66989a93/systemvm/patches/debian/config/etc/vpcdnsmasq.conf
--
diff --git a/systemvm/patches/debian/config/etc/vpcdnsmasq.conf 
b/systemvm/patches/debian/config/etc/vpcdnsmasq.conf
index 3622d0e..d46d623 100644
--- a/systemvm/patches/debian/config/etc/vpcdnsmasq.conf
+++ b/systemvm/patches/debian/config/etc/vpcdnsmasq.conf
@@ -334,7 +334,7 @@ dhcp-option=vendor:MSFT,2,1i
 #dhcp-boot=/var/ftpd/pxelinux.0,boothost,192.168.0.3
 
 # Set the limit on DHCP leases, the default is 150
-#dhcp-lease-max=150
+dhcp-lease-max=2100
 
 # The DHCP server needs somewhere on disk to keep its lease database.
 # This defaults to a sane location, but if you want to change it, use



git commit: updated refs/heads/master to 657d9e4

2014-02-03 Thread anthonyxu
Updated Branches:
  refs/heads/master 66989a936 -> 657d9e478


Allow different VLANs have ovveride subnet for shared network


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

Branch: refs/heads/master
Commit: 657d9e4789d73c7c8ed460e59f088b8cb9aa7697
Parents: 66989a9
Author: Anthony Xu 
Authored: Mon Feb 3 15:02:36 2014 -0800
Committer: Anthony Xu 
Committed: Mon Feb 3 15:03:31 2014 -0800

--
 .../configuration/ConfigurationManagerImpl.java | 63 
 1 file changed, 39 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/657d9e47/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
--
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java 
b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index 0109b4b..49fee93 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -2864,40 +2864,55 @@ public class ConfigurationManagerImpl extends 
ManagerBase implements Configurati
 String otherVlanGateway = vlan.getVlanGateway();
 String otherVlanNetmask = vlan.getVlanNetmask();
 // Continue if it's not IPv4
-if (otherVlanGateway == null || otherVlanNetmask == null) {
+if ( otherVlanGateway == null || otherVlanNetmask == null ) {
 continue;
 }
-if (vlan.getNetworkId() == null) {
+if ( vlan.getNetworkId() == null ) {
 continue;
 }
 String otherCidr = 
NetUtils.getCidrFromGatewayAndNetmask(otherVlanGateway, otherVlanNetmask);
-if (!NetUtils.isNetworksOverlap(newCidr, otherCidr)) {
+if( !NetUtils.isNetworksOverlap(newCidr,  otherCidr)) {
 continue;
 }
 // from here, subnet overlaps
-if (!NetUtils.isSameIsolationId(vlanId, vlan.getVlanTag())) {
-throw new InvalidParameterValueException("The IP range 
with tag: " + vlan.getVlanTag() + " in zone " + zone.getName()
-+ " has overlapped with the subnet. Please specify 
a different gateway/netmask.");
-}
-if (vlan.getNetworkId() != networkId) {
-throw new InvalidParameterValueException("This subnet is 
overlapped with subnet in other network " + vlan.getNetworkId() + " in zone " + 
zone.getName()
-+ " . Please specify a different 
gateway/netmask.");
+if ( !vlanId.equals(vlan.getVlanTag()) ) {
+boolean overlapped = false;
+if( network.getTrafficType() == TrafficType.Public ) {
+overlapped = true;
+} else {
+Long nwId = vlan.getNetworkId();
+if ( nwId != null ) {
+Network nw = _networkModel.getNetwork(nwId);
+if ( nw != null && nw.getTrafficType() == 
TrafficType.Public ) {
+overlapped = true;
+}
+}
 
-}
-String[] otherVlanIpRange = vlan.getIpRange().split("\\-");
-String otherVlanStartIP = otherVlanIpRange[0];
-String otherVlanEndIP = null;
-if (otherVlanIpRange.length > 1) {
-otherVlanEndIP = otherVlanIpRange[1];
-}
+}
+if ( overlapped ) {
+throw new InvalidParameterValueException("The IP range 
with tag: " + vlan.getVlanTag()
++ " in zone " + zone.getName()
++ " has overlapped with the subnet. Please 
specify a different gateway/netmask.");
+}
+} else {
 
-//extend IP range
-if (!vlanGateway.equals(otherVlanGateway) || 
!vlanNetmask.equals(vlan.getVlanNetmask())) {
-throw new InvalidParameterValueException("The IP range has 
already been added with gateway " + otherVlanGateway + " ,and netmask " + 
otherVlanNetmask
-+ ", Please specify the gateway/netmask if you 
want to extend ip range");
-}
-if (NetUtils.ipRangesOverlap(startIP, endIP, otherVlanStartIP, 
otherVlanE

git commit: updated refs/heads/4.3-forward to b11c13d

2014-02-03 Thread mchen
Updated Branches:
  refs/heads/4.3-forward 50234ea72 -> b11c13d4a


CLOUDSTACK-6019:CreateVolume from snapshot in NFS is throwing Warning
"sync snapshot from cache to region wide store failed for image store
test".


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

Branch: refs/heads/4.3-forward
Commit: b11c13d4a120a6361231ee415082576dac6fe385
Parents: 50234ea
Author: Min Chen 
Authored: Mon Feb 3 16:26:40 2014 -0800
Committer: Min Chen 
Committed: Mon Feb 3 16:27:31 2014 -0800

--
 .../resource/VmwareStorageSubsystemCommandHandler.java  | 9 +
 1 file changed, 9 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b11c13d4/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java
--
diff --git 
a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java
 
b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java
index d1b8be8..5eccc3c 100644
--- 
a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java
+++ 
b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java
@@ -95,6 +95,15 @@ public class VmwareStorageSubsystemCommandHandler extends 
StorageSubsystemComman
 } else if (srcData.getObjectType() == DataObjectType.TEMPLATE) {
 // sync template from NFS cache to S3 in NFS migration to S3 
case
 storageManager.createOvaForTemplate((TemplateObjectTO)srcData);
+} else if (srcData.getObjectType() == DataObjectType.SNAPSHOT && 
destData.getObjectType() == DataObjectType.SNAPSHOT) {
+// sync snapshot from NFS cache to S3 in NFS migration to S3 
case
+String parentPath = 
storageResource.getRootDir(srcDataStore.getUrl());
+SnapshotObjectTO snap = (SnapshotObjectTO)srcData;
+String path = snap.getPath();
+int index = path.lastIndexOf(File.separator);
+String name = path.substring(index + 1);
+String snapDir = path.substring(0, index);
+storageManager.createOva(parentPath + File.separator + 
snapDir, name);
 } else if (srcData.getObjectType() == DataObjectType.SNAPSHOT && 
destData.getObjectType() == DataObjectType.TEMPLATE) {
 //create template from snapshot on src at first, then copy it 
to s3
 TemplateObjectTO cacheTemplate = (TemplateObjectTO)destData;



git commit: updated refs/heads/master to 30695d7

2014-02-03 Thread mchen
Updated Branches:
  refs/heads/master 657d9e478 -> 30695d7f9


CLOUDSTACK-6019:CreateVolume from snapshot in NFS is throwing Warning
"sync snapshot from cache to region wide store failed for image store
test".


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

Branch: refs/heads/master
Commit: 30695d7f93b6cccf8139d5f1e342d0ab8ebb5eec
Parents: 657d9e4
Author: Min Chen 
Authored: Mon Feb 3 16:26:40 2014 -0800
Committer: Min Chen 
Committed: Mon Feb 3 16:41:04 2014 -0800

--
 .../resource/VmwareStorageSubsystemCommandHandler.java  | 9 +
 1 file changed, 9 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30695d7f/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java
--
diff --git 
a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java
 
b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java
index 39c3539..a5ebe2e 100644
--- 
a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java
+++ 
b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java
@@ -92,6 +92,15 @@ public class VmwareStorageSubsystemCommandHandler extends 
StorageSubsystemComman
 } else if (srcData.getObjectType() == DataObjectType.TEMPLATE) {
 // sync template from NFS cache to S3 in NFS migration to S3 
case
 storageManager.createOvaForTemplate((TemplateObjectTO)srcData);
+} else if (srcData.getObjectType() == DataObjectType.SNAPSHOT && 
destData.getObjectType() == DataObjectType.SNAPSHOT) {
+// sync snapshot from NFS cache to S3 in NFS migration to S3 
case
+String parentPath = 
storageResource.getRootDir(srcDataStore.getUrl());
+SnapshotObjectTO snap = (SnapshotObjectTO)srcData;
+String path = snap.getPath();
+int index = path.lastIndexOf(File.separator);
+String name = path.substring(index + 1);
+String snapDir = path.substring(0, index);
+storageManager.createOva(parentPath + File.separator + 
snapDir, name);
 } else if (srcData.getObjectType() == DataObjectType.SNAPSHOT && 
destData.getObjectType() == DataObjectType.TEMPLATE) {
 //create template from snapshot on src at first, then copy it 
to s3
 TemplateObjectTO cacheTemplate = (TemplateObjectTO)destData;



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

2014-02-03 Thread alena1108
Updated Branches:
  refs/heads/master 30695d7f9 -> ea355d738


listSslCerts: removed an exception thrown when there is no certificate mapped 
to the lbId specified in the list* command. Exception in the list* command 
should be thrown only when id specified in the command, is invalid CS id, but 
never in the case when we can't find data satisfying search criteria. In this 
case we just return empty list


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

Branch: refs/heads/master
Commit: ea355d73837b0a04d68b6d5704a73b07bdf24721
Parents: fc56f0c
Author: Alena Prokharchyk 
Authored: Mon Feb 3 15:53:29 2014 -0800
Committer: Alena Prokharchyk 
Committed: Mon Feb 3 17:20:28 2014 -0800

--
 .../apache/cloudstack/network/lb/CertServiceImpl.java | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ea355d73/server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java
--
diff --git a/server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java 
b/server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java
index dd536fe..d3c5dc5 100644
--- a/server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java
+++ b/server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java
@@ -53,18 +53,17 @@ import javax.crypto.NoSuchPaddingException;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.commons.io.IOUtils;
-import org.apache.log4j.Logger;
-import org.bouncycastle.jce.provider.BouncyCastleProvider;
-import org.bouncycastle.openssl.PEMReader;
-import org.bouncycastle.openssl.PasswordFinder;
-
 import org.apache.cloudstack.acl.SecurityChecker;
 import org.apache.cloudstack.api.command.user.loadbalancer.DeleteSslCertCmd;
 import org.apache.cloudstack.api.command.user.loadbalancer.ListSslCertsCmd;
 import org.apache.cloudstack.api.command.user.loadbalancer.UploadSslCertCmd;
 import org.apache.cloudstack.api.response.SslCertResponse;
 import org.apache.cloudstack.context.CallContext;
+import org.apache.commons.io.IOUtils;
+import org.apache.log4j.Logger;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.openssl.PEMReader;
+import org.bouncycastle.openssl.PasswordFinder;
 
 import com.cloud.event.ActionEvent;
 import com.cloud.event.EventTypes;
@@ -213,7 +212,8 @@ public class CertServiceImpl implements CertService {
 lbCertMapRule = _lbCertDao.findByLbRuleId(lbRuleId);
 
 if (lbCertMapRule == null) {
-throw new InvalidParameterValueException("No certificate bound 
to loadbalancer id: " + lbRuleId);
+s_logger.debug("No certificate bound to loadbalancer id: " + 
lbRuleId);
+return certResponseList;
 }
 
 certVO = _sslCertDao.findById(lbCertMapRule.getCertId());



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

2014-02-03 Thread alena1108
Revert "Findbugs: different issues solved(cherry picked from commit" as it 
breaks UserVm API Response

This reverts commit fae05560218ef3bcb962bd424ae5dbf5cb8ede68.

Conflicts:
server/src/com/cloud/dc/DedicatedResourceVO.java


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

Branch: refs/heads/master
Commit: fc56f0cf42895a792a257d7c5ca4ebb40d56b959
Parents: 30695d7
Author: Alena Prokharchyk 
Authored: Mon Feb 3 15:27:48 2014 -0800
Committer: Alena Prokharchyk 
Committed: Mon Feb 3 17:20:28 2014 -0800

--
 .../com/cloud/api/query/vo/UserVmJoinVO.java| 23 
 .../com/cloud/consoleproxy/AgentHookBase.java   |  5 +-
 .../src/com/cloud/dc/DedicatedResourceVO.java   | 10 ++--
 .../com/cloud/network/IpAddressManagerImpl.java | 60 +---
 .../src/com/cloud/network/NetworkModelImpl.java |  7 +--
 .../cloud/network/guru/ControlNetworkGuru.java  |  4 +-
 .../com/cloud/network/vpc/VpcManagerImpl.java   |  4 +-
 .../com/cloud/template/TemplateManagerImpl.java |  4 +-
 8 files changed, 52 insertions(+), 65 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fc56f0cf/server/src/com/cloud/api/query/vo/UserVmJoinVO.java
--
diff --git a/server/src/com/cloud/api/query/vo/UserVmJoinVO.java 
b/server/src/com/cloud/api/query/vo/UserVmJoinVO.java
index 9e4fc21..2df49ec 100644
--- a/server/src/com/cloud/api/query/vo/UserVmJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/UserVmJoinVO.java
@@ -35,7 +35,6 @@ import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.storage.Storage.StoragePoolType;
 import com.cloud.storage.Volume;
 import com.cloud.utils.db.GenericDao;
-import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachine.State;
 
@@ -48,10 +47,10 @@ public class UserVmJoinVO extends BaseViewVO implements 
ControlledViewEntity {
 private long id;
 
 @Column(name = "name", updatable = false, nullable = false, length = 255)
-private final String name = null;
+private String name = null;
 
 @Column(name = "display_name", updatable = false, nullable = false, length 
= 255)
-private final String displayName = null;
+private String displayName = null;
 
 @Column(name = "account_id")
 private long accountId;
@@ -60,7 +59,7 @@ public class UserVmJoinVO extends BaseViewVO implements 
ControlledViewEntity {
 private String accountUuid;
 
 @Column(name = "account_name")
-private final String accountName = null;
+private String accountName = null;
 
 @Column(name = "account_type")
 private short accountType;
@@ -72,10 +71,10 @@ public class UserVmJoinVO extends BaseViewVO implements 
ControlledViewEntity {
 private String domainUuid;
 
 @Column(name = "domain_name")
-private final String domainName = null;
+private String domainName = null;
 
 @Column(name = "domain_path")
-private final String domainPath = null;
+private String domainPath = null;
 
 @Column(name = "instance_group_id")
 private long instanceGroupId;
@@ -97,7 +96,7 @@ public class UserVmJoinVO extends BaseViewVO implements 
ControlledViewEntity {
  */
 @Enumerated(value = EnumType.STRING)
 @Column(name = "state", updatable = true, nullable = false, length = 32)
-private final State state = null;
+private State state = null;
 
 @Column(name = GenericDao.CREATED_COLUMN)
 private Date created;
@@ -149,7 +148,7 @@ public class UserVmJoinVO extends BaseViewVO implements 
ControlledViewEntity {
 private String dataCenterUuid;
 
 @Column(name = "data_center_name")
-private final String dataCenterName = null;
+private String dataCenterName = null;
 
 @Column(name = "security_group_enabled")
 private boolean securityGroupEnabled;
@@ -234,7 +233,7 @@ public class UserVmJoinVO extends BaseViewVO implements 
ControlledViewEntity {
 private String volumeUuid;
 
 @Column(name = "volume_device_id")
-private final Long volumeDeviceId = null;
+private Long volumeDeviceId = null;
 
 @Column(name = "volume_type")
 @Enumerated(EnumType.STRING)
@@ -746,11 +745,9 @@ public class UserVmJoinVO extends BaseViewVO implements 
ControlledViewEntity {
 }
 
 public String getDetail(String name) {
-if (details == null) {
-throw new CloudRuntimeException("No details to get. Did you forget 
to load the details?");
-}
+assert (details != null) : "Did you forget to load the details?";
 
-return details.get(name);
+  

[1/2] git commit: updated refs/heads/rbac to a6d07c8

2014-02-03 Thread prachidamle
Updated Branches:
  refs/heads/rbac 09eed3705 -> a6d07c873


changes to support the domain wide resources for Network


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

Branch: refs/heads/rbac
Commit: 939b15169c512c2149d412204930c89976db2ba5
Parents: 09eed37
Author: Prachi Damle 
Authored: Mon Feb 3 17:34:03 2014 -0800
Committer: Prachi Damle 
Committed: Mon Feb 3 17:34:03 2014 -0800

--
 .../orchestration/NetworkOrchestrator.java  |  4 ++
 server/src/com/cloud/user/DomainManager.java|  1 +
 .../acl/RoleBasedEntityAccessChecker.java   | 10 +++
 .../cloudstack/acl/api/AclApiServiceImpl.java   | 15 +
 .../apache/cloudstack/iam/api/IAMService.java   |  4 ++
 .../cloudstack/iam/server/IAMServiceImpl.java   | 65 
 6 files changed, 99 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/939b1516/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
--
diff --git 
a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
 
b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
index 8857c00..de22e9d 100755
--- 
a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
+++ 
b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
@@ -2196,6 +2196,10 @@ public class NetworkOrchestrator extends ManagerBase 
implements NetworkOrchestra
 NetworkAccountVO networkAccount = 
_networkAccountDao.getAccountNetworkMapByNetworkId(networkFinal.getId());
 if (networkAccount != null)
 
_networkAccountDao.remove(networkAccount.getId());
+
+// remove its related ACL permission
+Pair networkMsg = new 
Pair(AclEntityType.Network, networkFinal.getId());
+_messageBus.publish(_name, 
EntityManager.MESSAGE_REMOVE_ENTITY_EVENT, PublishScope.LOCAL, networkMsg);
 }
 
 NetworkOffering ntwkOff = 
_entityMgr.findById(NetworkOffering.class, networkFinal.getNetworkOfferingId());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/939b1516/server/src/com/cloud/user/DomainManager.java
--
diff --git a/server/src/com/cloud/user/DomainManager.java 
b/server/src/com/cloud/user/DomainManager.java
index 27c837d..592ab81 100644
--- a/server/src/com/cloud/user/DomainManager.java
+++ b/server/src/com/cloud/user/DomainManager.java
@@ -49,5 +49,6 @@ public interface DomainManager extends DomainService {
 Domain updateDomain(UpdateDomainCmd cmd);
 
 public static final String MESSAGE_ADD_DOMAIN_EVENT = 
"Message.AddDomain.Event";
+public static final String MESSAGE_REMOVE_DOMAIN_EVENT = 
"Message.RemoveDomain.Event";
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/939b1516/services/iam/plugin/src/org/apache/cloudstack/acl/RoleBasedEntityAccessChecker.java
--
diff --git 
a/services/iam/plugin/src/org/apache/cloudstack/acl/RoleBasedEntityAccessChecker.java
 
b/services/iam/plugin/src/org/apache/cloudstack/acl/RoleBasedEntityAccessChecker.java
index acbf8d3..1b915d5a 100644
--- 
a/services/iam/plugin/src/org/apache/cloudstack/acl/RoleBasedEntityAccessChecker.java
+++ 
b/services/iam/plugin/src/org/apache/cloudstack/acl/RoleBasedEntityAccessChecker.java
@@ -25,6 +25,7 @@ import javax.inject.Inject;
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.api.InternalIdentity;
+import org.apache.cloudstack.iam.api.AclGroup;
 import org.apache.cloudstack.iam.api.AclPolicy;
 import org.apache.cloudstack.iam.api.AclPolicyPermission;
 import org.apache.cloudstack.iam.api.IAMService;
@@ -168,6 +169,15 @@ public class RoleBasedEntityAccessChecker extends 
DomainChecker implements Secur
 policies.add(_iamSrv.getResourceOwnerPolicy());
 }
 
+List groups = _iamSrv.listAclGroups(caller.getId());
+for (AclGroup group : groups) {
+// for each group find the grand parent groups.
+List parentGroups = 
_iamSrv.listParentAclGroupsOnPath(group.getPath());
+for (AclGroup parentGroup : parentGroups) {
+
policies.addAll(_iamSrv.listRecursiveAclPoliciesByGroup(parentGroup.getId())

[2/2] git commit: updated refs/heads/rbac to a6d07c8

2014-02-03 Thread prachidamle
Changes to QuerySelector to list the parent group resources with recursive = 
true access


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

Branch: refs/heads/rbac
Commit: a6d07c873cac5eb16c5de7ae29f2912a7501ac6a
Parents: 939b151
Author: Prachi Damle 
Authored: Mon Feb 3 17:49:33 2014 -0800
Committer: Prachi Damle 
Committed: Mon Feb 3 17:49:33 2014 -0800

--
 .../engine/orchestration/NetworkOrchestrator.java|  2 +-
 .../cloudstack/acl/RoleBasedEntityAccessChecker.java |  2 +-
 .../cloudstack/acl/RoleBasedEntityQuerySelector.java | 11 +++
 .../src/org/apache/cloudstack/iam/api/IAMService.java|  2 +-
 .../org/apache/cloudstack/iam/server/IAMServiceImpl.java |  7 ++-
 5 files changed, 20 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a6d07c87/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
--
diff --git 
a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
 
b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
index de22e9d..1ea8d2e 100755
--- 
a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
+++ 
b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
@@ -2196,7 +2196,7 @@ public class NetworkOrchestrator extends ManagerBase 
implements NetworkOrchestra
 NetworkAccountVO networkAccount = 
_networkAccountDao.getAccountNetworkMapByNetworkId(networkFinal.getId());
 if (networkAccount != null)
 
_networkAccountDao.remove(networkAccount.getId());
-
+
 // remove its related ACL permission
 Pair networkMsg = new 
Pair(AclEntityType.Network, networkFinal.getId());
 _messageBus.publish(_name, 
EntityManager.MESSAGE_REMOVE_ENTITY_EVENT, PublishScope.LOCAL, networkMsg);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a6d07c87/services/iam/plugin/src/org/apache/cloudstack/acl/RoleBasedEntityAccessChecker.java
--
diff --git 
a/services/iam/plugin/src/org/apache/cloudstack/acl/RoleBasedEntityAccessChecker.java
 
b/services/iam/plugin/src/org/apache/cloudstack/acl/RoleBasedEntityAccessChecker.java
index 1b915d5a..65249a6 100644
--- 
a/services/iam/plugin/src/org/apache/cloudstack/acl/RoleBasedEntityAccessChecker.java
+++ 
b/services/iam/plugin/src/org/apache/cloudstack/acl/RoleBasedEntityAccessChecker.java
@@ -172,7 +172,7 @@ public class RoleBasedEntityAccessChecker extends 
DomainChecker implements Secur
 List groups = _iamSrv.listAclGroups(caller.getId());
 for (AclGroup group : groups) {
 // for each group find the grand parent groups.
-List parentGroups = 
_iamSrv.listParentAclGroupsOnPath(group.getPath());
+List parentGroups = 
_iamSrv.listParentAclGroups(group.getId());
 for (AclGroup parentGroup : parentGroups) {
 
policies.addAll(_iamSrv.listRecursiveAclPoliciesByGroup(parentGroup.getId()));
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a6d07c87/services/iam/plugin/src/org/apache/cloudstack/acl/RoleBasedEntityQuerySelector.java
--
diff --git 
a/services/iam/plugin/src/org/apache/cloudstack/acl/RoleBasedEntityQuerySelector.java
 
b/services/iam/plugin/src/org/apache/cloudstack/acl/RoleBasedEntityQuerySelector.java
index 8299819..8ff81ed 100644
--- 
a/services/iam/plugin/src/org/apache/cloudstack/acl/RoleBasedEntityQuerySelector.java
+++ 
b/services/iam/plugin/src/org/apache/cloudstack/acl/RoleBasedEntityQuerySelector.java
@@ -83,6 +83,17 @@ public class RoleBasedEntityQuerySelector extends 
AdapterBase implements QuerySe
 long accountId = caller.getAccountId();
 // Get the static Policies of the Caller
 List policies = _iamService.listAclPolicies(accountId);
+
+// add the policies that grant recursive access
+List groups = _iamService.listAclGroups(caller.getId());
+for (AclGroup group : groups) {
+// for each group find the grand parent groups.
+List parentGroups = 
_iamService.listParentAclGroups(group.getId());
+for (AclGroup parentGroup : parentGroup

[3/3] git commit: updated refs/heads/rbac to 72c0f1a

2014-02-03 Thread prachidamle
Remove trailing whitespace


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

Branch: refs/heads/rbac
Commit: 72c0f1a6176754a089722bc6502689f78577744e
Parents: cb4d3a3
Author: Prachi Damle 
Authored: Mon Feb 3 18:28:09 2014 -0800
Committer: Prachi Damle 
Committed: Mon Feb 3 18:28:09 2014 -0800

--
 .../org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/72c0f1a6/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java
--
diff --git 
a/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java 
b/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java
index 27c541b..9fc9f0f 100644
--- a/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java
+++ b/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java
@@ -46,8 +46,6 @@ import com.cloud.event.ActionEvent;
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.exception.PermissionDeniedException;
-import com.cloud.network.dao.NetworkAccountVO;
-import com.cloud.network.dao.NetworkDomainVO;
 import com.cloud.user.Account;
 import com.cloud.user.AccountManager;
 import com.cloud.user.DomainManager;
@@ -284,7 +282,7 @@ public class AffinityGroupServiceImpl extends ManagerBase 
implements AffinityGro
 listByAffinityGroup.done();
 SearchCriteria sc = 
listByAffinityGroup.create();
 sc.setParameters("affinityGroupId", 
affinityGroupIdFinal);
-
+
 _affinityGroupVMMapDao.lockRows(sc, null, true);
 _affinityGroupVMMapDao.remove(sc);
 }



[1/3] git commit: updated refs/heads/rbac to 72c0f1a

2014-02-03 Thread prachidamle
Updated Branches:
  refs/heads/rbac a6d07c873 -> 72c0f1a61


Add access for domain wide createAffinityGroup


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

Branch: refs/heads/rbac
Commit: 022b9b8f8058ae982af5ec12812c932287f50cc6
Parents: a6d07c8
Author: Prachi Damle 
Authored: Mon Feb 3 18:14:56 2014 -0800
Committer: Prachi Damle 
Committed: Mon Feb 3 18:14:56 2014 -0800

--
 .../orchestration/NetworkOrchestrator.java  | 10 +--
 .../affinity/AffinityGroupServiceImpl.java  | 29 +++
 .../cloudstack/acl/api/AclApiServiceImpl.java   | 30 
 3 files changed, 42 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/022b9b8f/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
--
diff --git 
a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
 
b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
index 1ea8d2e..8684876 100755
--- 
a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
+++ 
b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
@@ -38,6 +38,7 @@ import javax.naming.ConfigurationException;
 
 import org.apache.cloudstack.acl.AclEntityType;
 import org.apache.cloudstack.acl.ControlledEntity.ACLType;
+import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.context.CallContext;
 import 
org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
 import org.apache.cloudstack.framework.config.ConfigDepot;
@@ -670,10 +671,13 @@ public class NetworkOrchestrator extends ManagerBase 
implements NetworkOrchestra
 if (domainId != null && aclType == ACLType.Domain) {
 _networksDao.addDomainToNetwork(id, domainId, 
subdomainAccess == null ? true : subdomainAccess);
 //send event for storing the domain wide resource 
access
-// remove its related ACL permission
-Pair network = new 
Pair(AclEntityType.Network, id);
+Map params = new HashMap();
+params.put(ApiConstants.ENTITY_TYPE, 
AclEntityType.Network);
+params.put(ApiConstants.ENTITY_ID, id);
+params.put(ApiConstants.DOMAIN_ID, domainId);
+params.put(ApiConstants.SUBDOMAIN_ACCESS, 
subdomainAccess == null ? true : subdomainAccess);
 _messageBus.publish(_name, 
EntityManager.MESSAGE_ADD_DOMAIN_WIDE_ENTITY_EVENT,
-PublishScope.LOCAL, network);
+PublishScope.LOCAL, params);
 }
 }
 });

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/022b9b8f/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java
--
diff --git 
a/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java 
b/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java
index 2a6951e..ce56311 100644
--- a/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java
+++ b/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java
@@ -28,13 +28,17 @@ import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
 
+import org.apache.cloudstack.acl.AclEntityType;
 import org.apache.cloudstack.acl.ControlledEntity;
 import org.apache.cloudstack.acl.ControlledEntity.ACLType;
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.affinity.dao.AffinityGroupDao;
 import org.apache.cloudstack.affinity.dao.AffinityGroupDomainMapDao;
 import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao;
+import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.context.CallContext;
+import org.apache.cloudstack.framework.messagebus.MessageBus;
+import org.apache.cloudstack.framework.messagebus.PublishScope;
 
 import com.cloud.domain.DomainVO;
 import com.cloud.domain.dao.DomainDao;
@@ -50,6 +54,7 @@ import com.cloud.utils.Pair;
 import com.cloud.utils.component.Manager;
 import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.db.DB;
+import com.cloud.utils.db.EntityManager;
 import com.cloud.utils.db.Filter;
 imp

[2/3] git commit: updated refs/heads/rbac to 72c0f1a

2014-02-03 Thread prachidamle
Support deleteAffinitygroup - remove access


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

Branch: refs/heads/rbac
Commit: cb4d3a3c5499ea7436360dcc4f7b3e2e34002a9e
Parents: 022b9b8
Author: Prachi Damle 
Authored: Mon Feb 3 18:22:57 2014 -0800
Committer: Prachi Damle 
Committed: Mon Feb 3 18:22:57 2014 -0800

--
 .../affinity/AffinityGroupServiceImpl.java  | 49 
 1 file changed, 30 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cb4d3a3c/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java
--
diff --git 
a/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java 
b/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java
index ce56311..27c541b 100644
--- a/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java
+++ b/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java
@@ -46,6 +46,8 @@ import com.cloud.event.ActionEvent;
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.exception.PermissionDeniedException;
+import com.cloud.network.dao.NetworkAccountVO;
+import com.cloud.network.dao.NetworkDomainVO;
 import com.cloud.user.Account;
 import com.cloud.user.AccountManager;
 import com.cloud.user.DomainManager;
@@ -271,29 +273,38 @@ public class AffinityGroupServiceImpl extends ManagerBase 
implements AffinityGro
 public void doInTransactionWithoutResult(TransactionStatus status) 
{
 
 AffinityGroupVO group = 
_affinityGroupDao.lockRow(affinityGroupIdFinal, true);
-if (group == null) {
-throw new InvalidParameterValueException("Unable to find 
affinity group by id " + affinityGroupIdFinal);
-}
+if (group == null) {
+throw new InvalidParameterValueException("Unable 
to find affinity group by id " + affinityGroupIdFinal);
+}
 
 List affinityGroupVmMap = 
_affinityGroupVMMapDao.listByAffinityGroup(affinityGroupIdFinal);
-if (!affinityGroupVmMap.isEmpty()) {
-SearchBuilder listByAffinityGroup = 
_affinityGroupVMMapDao.createSearchBuilder();
-listByAffinityGroup.and("affinityGroupId", 
listByAffinityGroup.entity().getAffinityGroupId(), SearchCriteria.Op.EQ);
-listByAffinityGroup.done();
-SearchCriteria sc = 
listByAffinityGroup.create();
-sc.setParameters("affinityGroupId", affinityGroupIdFinal);
-
-_affinityGroupVMMapDao.lockRows(sc, null, true);
-_affinityGroupVMMapDao.remove(sc);
-}
+if (!affinityGroupVmMap.isEmpty()) {
+SearchBuilder listByAffinityGroup = 
_affinityGroupVMMapDao.createSearchBuilder();
+listByAffinityGroup.and("affinityGroupId", 
listByAffinityGroup.entity().getAffinityGroupId(), SearchCriteria.Op.EQ);
+listByAffinityGroup.done();
+SearchCriteria sc = 
listByAffinityGroup.create();
+sc.setParameters("affinityGroupId", 
affinityGroupIdFinal);
+
+_affinityGroupVMMapDao.lockRows(sc, null, true);
+_affinityGroupVMMapDao.remove(sc);
+}
 
-// call processor to handle the group delete
-AffinityGroupProcessor processor = 
getAffinityGroupProcessorForType(group.getType());
-if (processor != null) {
-processor.handleDeleteGroup(group);
-}
+// call processor to handle the group delete
+AffinityGroupProcessor processor = 
getAffinityGroupProcessorForType(group.getType());
+if (processor != null) {
+processor.handleDeleteGroup(group);
+}
 
-_affinityGroupDao.expunge(affinityGroupIdFinal);
+if(_affinityGroupDao.expunge(affinityGroupIdFinal)){
+AffinityGroupDomainMapVO groupDomain = 
_affinityGroupDomainMapDao
+.findByAffinityGroup(affinityGroupIdFinal);
+if (groupDomain != null) {
+_affinityGroupDomainMapDao.remove(groupDomain.getId());
+}
+// remove its related ACL permission
+Pair params = new Pair(AclEntityType.AffinityGroup, affinityGroupIdFinal);
+_messageBus.publish(_name, 
EntityManager.MESSAGE

git commit: updated refs/heads/marvin to a908b8d

2014-02-03 Thread girish
Updated Branches:
  refs/heads/marvin df58f51e3 -> a908b8d94


CLOUDSTACK-5793: Fixed few issues related CLOUDSTACK-5973


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

Branch: refs/heads/marvin
Commit: a908b8d94b3af207f4556d7d1271758c38ece3f4
Parents: df58f51
Author: Santhosh Edukulla 
Authored: Tue Feb 4 11:23:10 2014 +0530
Committer: Girish Shilamkar 
Committed: Tue Feb 4 11:23:10 2014 +0530

--
 .../component/test_add_remove_network.py| 46 ++--
 tools/marvin/marvin/sshClient.py| 40 +
 2 files changed, 55 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a908b8d9/test/integration/component/test_add_remove_network.py
--
diff --git a/test/integration/component/test_add_remove_network.py 
b/test/integration/component/test_add_remove_network.py
index 6eef71e..67ab24a 100644
--- a/test/integration/component/test_add_remove_network.py
+++ b/test/integration/component/test_add_remove_network.py
@@ -67,7 +67,7 @@ class Services:
 
 def __init__(self):
 self.services = {
-
+"sleep": 60,
 "ostype": "CentOS 5.3 (64-bit)",
 # Cent OS 5.3 (64 bit)
 
@@ -392,8 +392,7 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase):
 # Trying to add same network to vm for the second time
 with self.assertRaises(Exception) as e:
 self.addNetworkToVm(network, self.virtual_machine)
-
-self.debug("Adding same network again failed with exception: %s" % 
e.exception)
+self.debug("Adding same network again failed with exception: %s" % 
e.exception)
 
 return
 
@@ -515,7 +514,7 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase):
 with self.assertRaises(Exception) as e:
 self.addNetworkToVm(self.shared_network, self.virtual_machine,
 ipaddress = ipaddress)
-self.debug("API failed with exception: %s" % e.exception)
+self.debug("API failed with exception: %s" % e.exception)
 
 return
 
@@ -552,9 +551,7 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase):
 
 with self.assertRaises(Exception) as e:
 self.virtual_machine.add_nic(self.apiclient, network.id)
-network.delete(self.apiclient)
-
-self.debug("Operation failed with exception %s" % e.exception)
+self.debug("Operation failed with exception %s" % e.exception)
 
 return
 
@@ -606,15 +603,13 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase):
 
domainid=self.child_do_admin_2.domainid, 
serviceofferingid=self.service_offering.id,
 mode=self.zone.networktype)
 
+time.sleep(self.services["sleep"])
 self.debug("Trying to %s network in domain %s to a vm in domain %s, 
This should fail" %
(network.type, self.child_domain_1.name, 
self.child_domain_2.name))
 
 with self.assertRaises(Exception) as e:
 virtual_machine.add_nic(self.apiclient, network.id)
-self.debug("Operation failed with exception %s" % e.exception)
-
-network.delete(self.apiclient)
-
+self.debug("Operation failed with exception %s" % e.exception)
 return
 
 @attr(tags = ["advanced"])
@@ -686,7 +681,7 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase):
 
 with self.assertRaises(Exception) as e:
 virtual_machine.add_nic(self.apiclient, network_2.id)
-self.debug("Operation failed with exception %s" % e.exception)
+self.debug("Operation failed with exception %s" % e.exception)
 
 return
 
@@ -836,7 +831,7 @@ class 
TestRemoveNetworkFromVirtualMachine(cloudstackTestCase):
 self.virtual_machine.id)
 with self.assertRaises(Exception):
 self.virtual_machine.remove_nic(self.apiclient, 
vm_list[0].nic[0].id)
-self.debug("Removing default nic of vm failed")
+self.debug("Removing default nic of vm failed")
 return
 
 @attr(tags = ["advanced"])
@@ -867,7 +862,7 @@ class 
TestRemoveNetworkFromVirtualMachine(cloudstackTestCase):
 operation should fail")
 with self.assertRaises(Exception) as e:
 self.virtual_machine.remove_nic(self.apiclient, 
virtual_machine.nic[0].id)
-self.debug("Operation failed with exception: %s" % e.exception)
+self.debug("Operation failed with exception: %s" % 

[3/6] CLOUDSTACK-6006: Remove integration folder and lib

2014-02-03 Thread girish
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bf72441d/tools/marvin/marvin/integration/lib/common.py
--
diff --git a/tools/marvin/marvin/integration/lib/common.py 
b/tools/marvin/marvin/integration/lib/common.py
deleted file mode 100644
index 4177b91..000
--- a/tools/marvin/marvin/integration/lib/common.py
+++ /dev/null
@@ -1,955 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-"""Common functions
-"""
-
-#Import Local Modules
-from marvin.cloudstackAPI import (listConfigurations,
-  listPhysicalNetworks,
-  listRegions,
-  addNetworkServiceProvider,
-  updateNetworkServiceProvider,
-  listDomains,
-  listZones,
-  listPods,
-  listOsTypes,
-  listTemplates,
-  updateResourceLimit,
-  listRouters,
-  listNetworks,
-  listClusters,
-  listSystemVms,
-  listStoragePools,
-  listVirtualMachines,
-  listLoadBalancerRuleInstances,
-  listFirewallRules,
-  listVolumes,
-  listIsos,
-  listAccounts,
-  listSnapshotPolicies,
-  listDiskOfferings,
-  listVlanIpRanges,
-  listUsageRecords,
-  listNetworkServiceProviders,
-  listHosts,
-  listPublicIpAddresses,
-  listPortForwardingRules,
-  listLoadBalancerRules,
-  listSnapshots,
-  listUsers,
-  listEvents,
-  listServiceOfferings,
-  listVirtualRouterElements,
-  listNetworkOfferings,
-  listResourceLimits,
-  listVPCOfferings)
-from marvin.integration.lib.base import (Configurations,
- NetScaler,
- Template,
- Resources,
- PhysicalNetwork,
- Host)
-from marvin.integration.lib.utils import (get_process_status,
-  xsplit)
-
-from marvin.sshClient import SshClient
-import random
-from utils import *
-from base import *
-from marvin.codes import PASS
-from marvin.integration.lib.utils import validateList
-
-#Import System modules
-import time
-
-
-def is_config_suitable(apiclient, name, value):
-"""
-Ensure if the deployment has the expected `value` for the global setting 
`name'
-@return: true if value is set, else false
-"""
-configs = Configurations.list(apiclient, name=name)
-assert(configs is not None and isinstance(configs, list) and len(configs) 
> 0)
-return configs[0].value == value
-
-def wait_for_cleanup(apiclient, configs=None):
-"""Sleeps till the cleanup configs passed"""
-
-# Configs list consists of the list of global configs
-if not isinstance(configs, list):
-return
-for config in configs:
-cmd = listConfigurations.listConfigurationsCmd()
-cmd.name = config
-cmd.listall = True
-try:
-config_descs = apiclient.listConfigurations(cmd)
-except Exception as e:
-raise Exception("Failed to fetch configurations: %s" % e)
-
-if not isinstance(config_descs, list):
-rais

[1/6] CLOUDSTACK-6006: Remove integration folder and lib

2014-02-03 Thread girish
Updated Branches:
  refs/heads/marvin a908b8d94 -> bf72441d1


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bf72441d/tools/marvin/marvin/lib/common.py
--
diff --git a/tools/marvin/marvin/lib/common.py 
b/tools/marvin/marvin/lib/common.py
new file mode 100644
index 000..41416d4
--- /dev/null
+++ b/tools/marvin/marvin/lib/common.py
@@ -0,0 +1,955 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Common functions
+"""
+
+#Import Local Modules
+from marvin.cloudstackAPI import (listConfigurations,
+  listPhysicalNetworks,
+  listRegions,
+  addNetworkServiceProvider,
+  updateNetworkServiceProvider,
+  listDomains,
+  listZones,
+  listPods,
+  listOsTypes,
+  listTemplates,
+  updateResourceLimit,
+  listRouters,
+  listNetworks,
+  listClusters,
+  listSystemVms,
+  listStoragePools,
+  listVirtualMachines,
+  listLoadBalancerRuleInstances,
+  listFirewallRules,
+  listVolumes,
+  listIsos,
+  listAccounts,
+  listSnapshotPolicies,
+  listDiskOfferings,
+  listVlanIpRanges,
+  listUsageRecords,
+  listNetworkServiceProviders,
+  listHosts,
+  listPublicIpAddresses,
+  listPortForwardingRules,
+  listLoadBalancerRules,
+  listSnapshots,
+  listUsers,
+  listEvents,
+  listServiceOfferings,
+  listVirtualRouterElements,
+  listNetworkOfferings,
+  listResourceLimits,
+  listVPCOfferings)
+from marvin.lib.base import (Configurations,
+ NetScaler,
+ Template,
+ Resources,
+ PhysicalNetwork,
+ Host)
+from marvin.lib.utils import (get_process_status,
+  xsplit)
+
+from marvin.sshClient import SshClient
+import random
+from utils import *
+from base import *
+from marvin.codes import PASS
+from marvin.lib.utils import validateList
+
+#Import System modules
+import time
+
+
+def is_config_suitable(apiclient, name, value):
+"""
+Ensure if the deployment has the expected `value` for the global setting 
`name'
+@return: true if value is set, else false
+"""
+configs = Configurations.list(apiclient, name=name)
+assert(configs is not None and isinstance(configs, list) and len(configs) 
> 0)
+return configs[0].value == value
+
+def wait_for_cleanup(apiclient, configs=None):
+"""Sleeps till the cleanup configs passed"""
+
+# Configs list consists of the list of global configs
+if not isinstance(configs, list):
+return
+for config in configs:
+cmd = listConfigurations.listConfigurationsCmd()
+cmd.name = config
+cmd.listall = True
+try:
+config_descs = apiclient.listConfigurations(cmd)
+except Exception as e:
+raise Exception("Failed to fetch configurations: %s" % e)
+
+if not isinstance(config_descs, list):
+raise Exception("List configs

[5/6] CLOUDSTACK-6006: Remove integration folder and lib

2014-02-03 Thread girish
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bf72441d/test/integration/component/test_vm_passwdenabled.py
--
diff --git a/test/integration/component/test_vm_passwdenabled.py 
b/test/integration/component/test_vm_passwdenabled.py
index 5cfa525..038edc1 100644
--- a/test/integration/component/test_vm_passwdenabled.py
+++ b/test/integration/component/test_vm_passwdenabled.py
@@ -18,9 +18,9 @@ import marvin
 from marvin.cloudstackTestCase import *
 from marvin.cloudstackAPI import *
 from marvin.sshClient import SshClient
-from marvin.integration.lib.utils import *
-from marvin.integration.lib.base import *
-from marvin.integration.lib.common import *
+from marvin.lib.utils import *
+from marvin.lib.base import *
+from marvin.lib.common import *
 from nose.plugins.attrib import attr
 
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bf72441d/test/integration/component/test_vmware_drs.py
--
diff --git a/test/integration/component/test_vmware_drs.py 
b/test/integration/component/test_vmware_drs.py
index 6a99911..cc0d278 100644
--- a/test/integration/component/test_vmware_drs.py
+++ b/test/integration/component/test_vmware_drs.py
@@ -23,19 +23,19 @@ from nose.plugins.attrib import attr
 
 from marvin.cloudstackTestCase import cloudstackTestCase, unittest
 
-from marvin.integration.lib.base import (Account,
+from marvin.lib.base import (Account,
  AffinityGroup,
  Host,
  VirtualMachine,
  ServiceOffering)
 
-from marvin.integration.lib.common import (get_zone,
+from marvin.lib.common import (get_zone,
get_template,
get_domain,
get_pod
)
 
-from marvin.integration.lib.utils import (validateList,
+from marvin.lib.utils import (validateList,
   cleanup_resources,
   random_gen)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bf72441d/test/integration/component/test_volumes.py
--
diff --git a/test/integration/component/test_volumes.py 
b/test/integration/component/test_volumes.py
index ee0f91d..a501da7 100644
--- a/test/integration/component/test_volumes.py
+++ b/test/integration/component/test_volumes.py
@@ -20,9 +20,9 @@
 from nose.plugins.attrib import attr
 from marvin.cloudstackTestCase import *
 from marvin.cloudstackAPI import *
-from marvin.integration.lib.utils import *
-from marvin.integration.lib.base import *
-from marvin.integration.lib.common import *
+from marvin.lib.utils import *
+from marvin.lib.base import *
+from marvin.lib.common import *
 #Import System modules
 import time
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bf72441d/test/integration/component/test_vpc.py
--
diff --git a/test/integration/component/test_vpc.py 
b/test/integration/component/test_vpc.py
index ab3b5ab..fa72135 100644
--- a/test/integration/component/test_vpc.py
+++ b/test/integration/component/test_vpc.py
@@ -22,9 +22,9 @@ from nose.plugins.attrib import attr
 from marvin.cloudstackTestCase import *
 from marvin.cloudstackException import cloudstackAPIException
 from marvin.cloudstackAPI import *
-from marvin.integration.lib.utils import *
-from marvin.integration.lib.base import *
-from marvin.integration.lib.common import *
+from marvin.lib.utils import *
+from marvin.lib.base import *
+from marvin.lib.common import *
 
 
 class Services:

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bf72441d/test/integration/component/test_vpc_network.py
--
diff --git a/test/integration/component/test_vpc_network.py 
b/test/integration/component/test_vpc_network.py
index c393401..d827366 100644
--- a/test/integration/component/test_vpc_network.py
+++ b/test/integration/component/test_vpc_network.py
@@ -21,8 +21,8 @@
 from nose.plugins.attrib import attr
 from marvin.cloudstackTestCase import cloudstackTestCase, unittest
 from marvin.cloudstackAPI import startVirtualMachine, stopVirtualMachine
-from marvin.integration.lib.utils import cleanup_resources, validateList
-from marvin.integration.lib.base import (VirtualMachine,
+from marvin.lib.utils import cleanup_resources, validateList
+from marvin.lib.base import (VirtualMachine,
  ServiceOffering,
  Account,
  NATRule,
@@ -35,7 +35,7 @@ from marvin.integration.lib.base import (