You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ts...@apache.org on 2013/04/09 15:20:38 UTC

[01/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Updated Branches:
  refs/heads/marvin_refactor [created] 2a9906424


fixing the argparser return vals

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


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

Branch: refs/heads/marvin_refactor
Commit: 2598137370420adc31dfb62bbdb61863cbc9a679
Parents: a57cbfb
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Tue Mar 19 18:09:49 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:00:35 2013 +0530

----------------------------------------------------------------------
 tools/marvin/marvin/deployAndRun.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/25981373/tools/marvin/marvin/deployAndRun.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/deployAndRun.py b/tools/marvin/marvin/deployAndRun.py
index 54161eb..c83065a 100644
--- a/tools/marvin/marvin/deployAndRun.py
+++ b/tools/marvin/marvin/deployAndRun.py
@@ -31,7 +31,7 @@ if __name__ == "__main__":
     parser.add_argument("-l", "--load", dest="load", action="store_true",
         help="only load config, do not deploy, it will only run testcase")
 
-    (options, args) = parser.parse_args()
+    options = parser.parse_args()
 
     testResultLogFile = None
     if options.result is not None:


[45/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
sg offering test

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


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

Branch: refs/heads/marvin_refactor
Commit: fed58404f737fa619369f4c459c9bc0de8b24942
Parents: cef6634
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Sun Mar 31 19:46:37 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:19:29 2013 +0530

----------------------------------------------------------------------
 .../lib/factory/NetworkOfferingFactory.py          |    2 +-
 .../integration/lib/factory/test/testFactories.py  |   14 ++++++++++----
 2 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fed58404/tools/marvin/marvin/integration/lib/factory/NetworkOfferingFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/NetworkOfferingFactory.py b/tools/marvin/marvin/integration/lib/factory/NetworkOfferingFactory.py
index 3673828..8b00819 100644
--- a/tools/marvin/marvin/integration/lib/factory/NetworkOfferingFactory.py
+++ b/tools/marvin/marvin/integration/lib/factory/NetworkOfferingFactory.py
@@ -60,7 +60,7 @@ class DefaultSharedNetworkOfferingWithSGServiceFactory(NetworkOfferingFactory):
     displaytext = factory.Sequence(lambda n : "DefaultSharedNetworkOfferingWithSGService" + random_gen())
     name = factory.Sequence(lambda n : "DefaultSharedNetworkOfferingWithSGService" + random_gen())
     availability = "Optional"
-    supportedservices = "SecurityGroup, Dns, Dhcp, UserData"
+    supportedservices = "SecurityGroup,Dns,Dhcp,UserData"
     guestiptype = "Shared"
     traffictype = "GUEST"
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fed58404/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/test/testFactories.py b/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
index 1d18305..1637020 100644
--- a/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
+++ b/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
@@ -19,13 +19,13 @@ import unittest
 from marvin.cloudstackTestClient import cloudstackTestClient
 
 from marvin.integration.lib.factory.AccountFactory import *
-from marvin.integration.lib.base.Account import *
+from marvin.integration.lib.base.Account import Account
 
 from marvin.integration.lib.factory.ServiceOfferingFactory import *
-from marvin.integration.lib.base.ServiceOffering import *
+from marvin.integration.lib.base.ServiceOffering import ServiceOffering
 
 from marvin.integration.lib.factory.NetworkOfferingFactory import *
-from marvin.integration.lib.base.NetworkOffering import *
+from marvin.integration.lib.base.NetworkOffering import NetworkOffering
 
 class AccountFactoryTest(unittest.TestCase):
     def setUp(self):
@@ -86,4 +86,10 @@ class NetworkOfferingFactoryTest(unittest.TestCase):
         self.assertTrue(snatOffering is not None, msg = "no network offering was created")
         self.assertEqual(snatOffering.name, snatOfferingFactory.name, msg="error in network offering factory creation")
 
-        snatOffering.update(self.apiClient, state='Enabled')
+    def test_defaultSGOfferingEnable(self):
+        sgOfferingFactory = DefaultSharedNetworkOfferingWithSGServiceFactory()
+        sgOffering = NetworkOffering.create(apiclient=self.apiClient, NetworkOfferingFactory=sgOfferingFactory)
+        sgOffering.update(self.apiClient, state='Enabled')
+
+    def tearDown(self):
+        pass
\ No newline at end of file


[44/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
simulator: removing cyclic dependency from simulator

The database creator caused a cyclic dependecny in the simulator which
is removed with this commit. Additionally the simulator profile is now
merged with developer profile and a test for server health is included

Steps to run:
$ mvn -Pdeveloper clean install
$ mvn -Pdeveloper -pl developer -Ddeploydb
$ mvn -Pdeveloper -pl developer -Ddeploydb-simulator
$ mvn -pl client jetty:run

To deploy an adv. zone and test the server health:
$ mvn -Pdeveloper,marvin -Dmarvin.config=`find . -name simulator.cfg` -pl :cloud-marvin test


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

Branch: refs/heads/marvin_refactor
Commit: 04bd6d1e5a2474c8f1ac2421171ca63f4408e490
Parents: 0eb8077
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Sun Mar 10 21:07:29 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:19:28 2013 +0530

----------------------------------------------------------------------
 client/tomcatconf/componentContext.xml.in |  166 ++++++++++++++++++++---
 pom.xml                                   |   18 +--
 2 files changed, 150 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/04bd6d1e/client/tomcatconf/componentContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/componentContext.xml.in b/client/tomcatconf/componentContext.xml.in
index 927dc51..43fc9aa 100644
--- a/client/tomcatconf/componentContext.xml.in
+++ b/client/tomcatconf/componentContext.xml.in
@@ -33,7 +33,6 @@
   <!--
     OSS deployment component configuration
   -->
-
   <bean id="databaseUpgradeChecker" class="com.cloud.upgrade.DatabaseUpgradeChecker" />
   <bean id="configurationDaoImpl" class="com.cloud.configuration.dao.ConfigurationDaoImpl" />
 
@@ -54,27 +53,132 @@
     </property>
   </bean>
 
-  <bean id="managementServerImpl" class ="com.cloud.server.ManagementServerImpl">
-    <property name="UserAuthenticators">
-      <list>
-          <ref bean="MD5UserAuthenticator"/>
-          <ref bean="LDAPUserAuthenticator"/>
-      </list>
-    </property>
-    <property name="HostAllocators">
-      <list>
-          <ref bean="FirstFitRouting"/>
-      </list>
-    </property>
+<!--
+  <bean id="BigSwitchVnsElementService" class="com.cloud.network.element.BigSwitchVnsElement">
+    <property name="name" value="BigSwitchVnsElementService"/>
   </bean>
+-->
 
-  <bean id="storageManagerImpl" class="com.cloud.storage.StorageManagerImpl">
-    <property name="StoragePoolAllocators">
-      <list>
-          <ref bean="LocalStoragePoolAllocator"/>
-          <ref bean="FirstFitStoragePoolAllocator"/>
-      </list>
-    </property>
+  <!--
+     Adapters
+  -->
+  <bean id="FirstFitRouting" class="com.cloud.agent.manager.allocator.impl.FirstFitRoutingAllocator">
+    <property name="name" value="FirstFitRouting"/>
+  </bean>
+
+  <bean id="hypervisorTemplateAdapter" class="com.cloud.template.HypervisorTemplateAdapter">
+    <property name="name" value="HypervisorAdapter"/>
+  </bean>
+
+   <bean id="bareMetalTemplateAdapter" class="com.cloud.baremetal.BareMetalTemplateAdapter">
+    <property name="name" value="BareMetalAdapter"/>
+  </bean>
+
+  <!--
+    Storage pool allocators
+  -->
+
+  <bean id="LocalStoragePoolAllocator" class="org.apache.cloudstack.storage.allocator.LocalStoragePoolAllocator">
+    <property name="name" value="LocalStorage"/>
+  </bean>
+  <!--
+  <bean id="FirstFitStoragePoolAllocator" class="org.apache.cloudstack.storage.allocator.FirstFitStoragePoolAllocator">
+    <property name="name" value="Storage"/>
+  </bean>
+  -->
+
+  <bean id="UserConcentratedAllocator" class="com.cloud.agent.manager.allocator.impl.UserConcentratedAllocator">
+    <property name="name" value="User First"/>
+  </bean>
+
+  <bean id="ConsoleProxyAllocator" class="com.cloud.consoleproxy.ConsoleProxyBalanceAllocator">
+    <property name="name" value="Balance"/>
+  </bean>
+
+  <bean id="StaticRoleBasedAPIAccessChecker" class="org.apache.cloudstack.acl.StaticRoleBasedAPIAccessChecker"/>
+
+  <bean id="ExteralIpAddressAllocator" class="com.cloud.network.ExteralIpAddressAllocator">
+    <property name="name" value="Basic"/>
+  </bean>
+
+  <bean id="HypervisorTemplateAdapter" class="com.cloud.template.HypervisorTemplateAdapter">
+    <property name="name" value="HypervisorAdapter"/>
+  </bean>
+
+  <bean id="BareMetalTemplateAdapter" class="com.cloud.baremetal.manager.BareMetalTemplateAdapter" >
+    <property name="name" value="BareMetalTemplateAdapter"/>
+  </bean>
+
+  <!--
+    Authenticators
+  -->
+  <bean id="MD5UserAuthenticator" class="com.cloud.server.auth.MD5UserAuthenticator">
+    <property name="name" value="MD5"/>
+  </bean>
+
+  <bean id="LDAPUserAuthenticator" class="com.cloud.server.auth.LDAPUserAuthenticator">
+    <property name="name" value="LDAP"/>
+  </bean>
+
+  <!--
+    Investigators
+  -->
+  <bean id="CheckOnAgentInvestigator" class="com.cloud.ha.CheckOnAgentInvestigator">
+    <property name="name" value="SimpleInvestigator"/>
+  </bean>
+
+  <bean id="XenServerInvestigator" class="com.cloud.ha.XenServerInvestigator">
+    <property name="name" value="XenServerInvestigator"/>
+  </bean>
+
+  <bean id="UserVmDomRInvestigator" class="com.cloud.ha.UserVmDomRInvestigator">
+    <property name="name" value="PingInvestigator"/>
+  </bean>
+
+  <bean id="ManagementIPSystemVMInvestigator" class="com.cloud.ha.ManagementIPSystemVMInvestigator">
+    <property name="name" value="ManagementIPSysVMInvestigator"/>
+  </bean>
+
+  <!--
+    Fencers
+  -->
+  <bean id="XenServerFencer" class="com.cloud.ha.XenServerFencer">
+    <property name="name" value="XenServerFenceBuilder"/>
+  </bean>
+  <bean id="KVMFencer" class="com.cloud.ha.KVMFencer">
+    <property name="name" value="KVMFenceBuilder"/>
+  </bean>
+  <bean id="OvmFencer" class="com.cloud.ovm.hypervisor.OvmFencer">
+    <property name="name" value="OvmFenceBuilder"/>
+  </bean>
+
+  <bean id="XcpServerDiscoverer" class="com.cloud.hypervisor.xen.discoverer.XcpServerDiscoverer">
+    <property name="name" value="XCP Agent"/>
+  </bean>
+
+  <bean id="SecondaryStorageDiscoverer" class="com.cloud.storage.secondary.SecondaryStorageDiscoverer">
+    <property name="name" value="SecondaryStorage"/>
+  </bean>
+
+  <bean id="KvmServerDiscoverer" class="com.cloud.hypervisor.kvm.discoverer.KvmServerDiscoverer">
+    <property name="name" value="KVM Agent"/>
+  </bean>
+
+  <bean id="SimulatorDiscoverer" class="com.cloud.resource.SimulatorDiscoverer">
+    <property name="name" value="Simulator Agent"/>
+  </bean>
+
+
+  <bean id="BareMetalDiscoverer" class="com.cloud.baremetal.manager.BareMetalDiscoverer">
+    <property name="name" value="Bare Metal Agent"/>
+  </bean>
+
+  <bean id="HypervServerDiscoverer" class="com.cloud.hypervisor.hyperv.HypervServerDiscoverer">
+    <property name="name" value="SCVMMServer"/>
+  </bean>
+
+  <bean id="OvmDiscoverer" class="com.cloud.ovm.hypervisor.OvmDiscoverer">
+    <property name="name" value="Ovm Discover"/>
   </bean>
 
   <bean id="FirstFitPlanner" class="com.cloud.deploy.FirstFitPlanner">
@@ -82,7 +186,9 @@
     <property name="StoragePoolAllocators">
       <list>
           <ref bean="LocalStoragePoolAllocator"/>
-          <ref bean="FirstFitStoragePoolAllocator"/>
+          <ref bean="clusterScopeStoragePoolAllocator"/>
+          <ref bean="zoneWideStoragePoolAllocator"/>
+          <ref bean="garbageCollectingStoragePoolAllocator"/>
       </list>
     </property>
     <property name="HostAllocators">
@@ -103,7 +209,11 @@
           <ref bean="XcpServerDiscoverer"/>
           <ref bean="SecondaryStorageDiscoverer"/>
           <ref bean="KvmServerDiscoverer"/>
+
+  <!--
           <ref bean="BareMetalDiscoverer"/>
+  -->
+
           <ref bean="OvmDiscoverer"/>
        </list>
     </property>
@@ -138,7 +248,11 @@
           <ref bean="FirstFitPlanner" />
           <ref bean="UserDispersingPlanner" />
           <ref bean="UserConcentratedPodPlanner" />
+
+<!--
           <ref bean="BareMetalPlanner" />
+-->
+
       </list>
     </property>
   </bean>
@@ -163,9 +277,11 @@
           <ref bean="Ovs"/>
           <ref bean="SecurityGroupProvider"/>
           <ref bean="VpcVirtualRouter"/>
+<!--
           <ref bean="BareMetalDhcp"/>
           <ref bean="BareMetalPxe"/>
           <ref bean="BareMetalUserdata"/>
+-->
       </list>
     </property>
     <property name="IpDeployers">
@@ -179,7 +295,9 @@
       <list>
           <ref bean="VirtualRouter"/>
           <ref bean="VpcVirtualRouter"/>
+<!--
           <ref bean="BareMetalDhcp"/>
+-->
       </list>
     </property>
   </bean>
@@ -191,13 +309,17 @@
           <ref bean="Ovs"/>
           <ref bean="SecurityGroupProvider"/>
           <ref bean="VpcVirtualRouter"/>
+<!--
           <ref bean="BareMetalDhcp"/>
           <ref bean="BareMetalPxe"/>
           <ref bean="BareMetalUserdata"/>
+-->
       </list>
     </property>
   </bean>
 
-  <bean id="GlobalLoadBalancingRulesServiceImpl" class ="org.apache.cloudstack.region.gslb.GlobalLoadBalancingRulesServiceImpl" />
+  <bean id="SimulatorGuru" class="com.cloud.simulator.SimulatorGuru">
+    <property name="name" value="SimulatorGuru"/>
+  </bean>
 
 </beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/04bd6d1e/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index ed24988..5e5f624 100644
--- a/pom.xml
+++ b/pom.xml
@@ -188,12 +188,12 @@
       <artifactId>junit</artifactId>
       <version>${cs.junit.version}</version>
       <scope>test</scope>
-	</dependency>
-	<dependency>
-	  <groupId>org.springframework</groupId>
-	  <artifactId>spring-core</artifactId>
-	  <version>${org.springframework.version}</version>
-	</dependency>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-core</artifactId>
+      <version>${org.springframework.version}</version>
+    </dependency>
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-context</artifactId>
@@ -216,12 +216,6 @@
       <version>${org.springframework.version}</version>
       <scope>test</scope>
     </dependency>
-	<dependency>
-	  <groupId>org.springframework</groupId>
-	  <artifactId>spring-test</artifactId>
-	  <version>${org.springframework.version}</version>
-	  <scope>test</scope>
-	</dependency>
     <dependency>
       <groupId>org.aspectj</groupId>
       <artifactId>aspectjrt</artifactId>


[29/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
Update unit test configuraitons to new custom Spring AOP


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

Branch: refs/heads/marvin_refactor
Commit: cb4ac1f93ded093a03f3feb944670f9a7ee51f27
Parents: 8165465
Author: Kelven Yang <ke...@gmail.com>
Authored: Fri Mar 29 11:01:40 2013 -0700
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:18:52 2013 +0530

----------------------------------------------------------------------
 .../networkoffering/CreateNetworkOfferingTest.java |   40 +++---
 .../resources/SecurityGroupManagerTestContext.xml  |   18 ++--
 server/test/resources/SnapshotDaoTestContext.xml   |   22 ++--
 .../test/resources/StoragePoolDaoTestContext.xml   |   22 ++--
 server/test/resources/VpcApiUnitTestContext.xml    |   22 ++--
 server/test/resources/VpcTestContext.xml           |   24 ++--
 server/test/resources/createNetworkOffering.xml    |   92 +++++++-------
 server/test/resources/testContext.xml              |   20 ++--
 8 files changed, 130 insertions(+), 130 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cb4ac1f9/server/test/org/apache/cloudstack/networkoffering/CreateNetworkOfferingTest.java
----------------------------------------------------------------------
diff --git a/server/test/org/apache/cloudstack/networkoffering/CreateNetworkOfferingTest.java b/server/test/org/apache/cloudstack/networkoffering/CreateNetworkOfferingTest.java
index 67fae33..5b236a5 100644
--- a/server/test/org/apache/cloudstack/networkoffering/CreateNetworkOfferingTest.java
+++ b/server/test/org/apache/cloudstack/networkoffering/CreateNetworkOfferingTest.java
@@ -57,29 +57,29 @@ import com.cloud.utils.component.ComponentContext;
 @ContextConfiguration(locations="classpath:/createNetworkOffering.xml")
 
 public class CreateNetworkOfferingTest extends TestCase{
-    
+
     @Inject
     ConfigurationManager configMgr;
-    
+
     @Inject
     ConfigurationDao configDao;
-    
+
     @Inject
     NetworkOfferingDao offDao;
-    
+
     @Inject
     NetworkOfferingServiceMapDao mapDao;
-    
+
     @Inject
     AccountManager accountMgr;
-    
+
     @Before
     public void setUp() {
-    	ComponentContext.initComponentsLifeCycle();
-    	
+	ComponentContext.initComponentsLifeCycle();
+
         ConfigurationVO configVO = new ConfigurationVO("200", "200","200","200","200","200");
         Mockito.when(configDao.findByName(Mockito.anyString())).thenReturn(configVO);
-        
+
         Mockito.when(offDao.persist(Mockito.any(NetworkOfferingVO.class))).thenReturn(new NetworkOfferingVO());
         Mockito.when(mapDao.persist(Mockito.any(NetworkOfferingServiceMapVO.class))).thenReturn(new NetworkOfferingServiceMapVO());
         Mockito.when(accountMgr.getSystemUser()).thenReturn(new UserVO(1));
@@ -96,7 +96,7 @@ public class CreateNetworkOfferingTest extends TestCase{
                 null, false, null, true, false);
         assertNotNull("Shared network offering with specifyVlan=true failed to create ", off);
     }
-    
+
     @Test
     public void createSharedNtwkOffWithNoVlan() {
         try {
@@ -107,16 +107,16 @@ public class CreateNetworkOfferingTest extends TestCase{
         } catch (InvalidParameterValueException ex) {
         }
     }
-    
+
     @Test
     public void createSharedNtwkOffWithSpecifyIpRanges() {
         NetworkOfferingVO off = configMgr.createNetworkOffering("shared", "shared", TrafficType.Guest, null, true,
                 Availability.Optional, 200, null, false, Network.GuestType.Shared, false,
                 null, false, null, true, false);
-        
+
         assertNotNull("Shared network offering with specifyIpRanges=true failed to create ", off);
     }
-    
+
     @Test
     public void createSharedNtwkOffWithoutSpecifyIpRanges() {
         try {
@@ -138,10 +138,10 @@ public class CreateNetworkOfferingTest extends TestCase{
         NetworkOfferingVO off = configMgr.createNetworkOffering("isolated", "isolated", TrafficType.Guest, null, false,
                 Availability.Optional, 200, serviceProviderMap, false, Network.GuestType.Isolated, false,
                 null, false, null, false, false);
-        
+
         assertNotNull("Isolated network offering with specifyIpRanges=false failed to create ", off);
     }
-    
+
     @Test
     public void createIsolatedNtwkOffWithVlan() {
         Map<Service, Set<Provider>> serviceProviderMap = new HashMap<Network.Service, Set<Network.Provider>>();
@@ -152,9 +152,9 @@ public class CreateNetworkOfferingTest extends TestCase{
                 Availability.Optional, 200, serviceProviderMap, false, Network.GuestType.Isolated, false,
                 null, false, null, false, false);
         assertNotNull("Isolated network offering with specifyVlan=true wasn't created", off);
-       
+
     }
-    
+
     @Test
     public void createIsolatedNtwkOffWithSpecifyIpRangesAndSourceNat() {
         try {
@@ -169,16 +169,16 @@ public class CreateNetworkOfferingTest extends TestCase{
         } catch (InvalidParameterValueException ex) {
         }
     }
-    
+
     @Test
     public void createIsolatedNtwkOffWithSpecifyIpRangesAndNoSourceNat() {
-        
+
         Map<Service, Set<Provider>> serviceProviderMap = new HashMap<Network.Service, Set<Network.Provider>>();
         Set<Network.Provider> vrProvider = new HashSet<Network.Provider>();
         NetworkOfferingVO off = configMgr.createNetworkOffering("isolated", "isolated", TrafficType.Guest, null, false,
                 Availability.Optional, 200, serviceProviderMap, false, Network.GuestType.Isolated, false,
                 null, false, null, true, false);
         assertNotNull("Isolated network offering with specifyIpRanges=true and with no sourceNatService, failed to create", off);
-        
+
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cb4ac1f9/server/test/resources/SecurityGroupManagerTestContext.xml
----------------------------------------------------------------------
diff --git a/server/test/resources/SecurityGroupManagerTestContext.xml b/server/test/resources/SecurityGroupManagerTestContext.xml
index 7ff2976..fc4b23e 100644
--- a/server/test/resources/SecurityGroupManagerTestContext.xml
+++ b/server/test/resources/SecurityGroupManagerTestContext.xml
@@ -23,16 +23,16 @@
   <context:annotation-config />
 
   <!-- @DB support -->
-  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
+  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
   <bean id="transactionContextBuilder" class="com.cloud.utils.db.TransactionContextBuilder" />
-  <bean id="instantiatePostProcessor" class="com.cloud.utils.component.ComponentInstantiationPostProcessor">
-    <property name="Interceptors">
-        <list>
-            <ref bean="transactionContextBuilder" />
-        </list>
-    </property>
-  </bean>
-
+  <bean id="instantiatePostProcessor" class="com.cloud.utils.component.ComponentInstantiationPostProcessor">
+    <property name="Interceptors">
+        <list>
+            <ref bean="transactionContextBuilder" />
+        </list>
+    </property>
+  </bean>
+
   <bean id="TestConfiguration"
     class="com.cloud.network.security.SecurityGroupManagerTestConfiguration" />
   <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor">

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cb4ac1f9/server/test/resources/SnapshotDaoTestContext.xml
----------------------------------------------------------------------
diff --git a/server/test/resources/SnapshotDaoTestContext.xml b/server/test/resources/SnapshotDaoTestContext.xml
index 3b87888..ac7c8a1 100644
--- a/server/test/resources/SnapshotDaoTestContext.xml
+++ b/server/test/resources/SnapshotDaoTestContext.xml
@@ -23,19 +23,19 @@
   <context:annotation-config />
 
   <!-- @DB support -->
-  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
+  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
 
   <bean id="transactionContextBuilder" class="com.cloud.utils.db.TransactionContextBuilder" />
-  <bean id="actionEventInterceptor" class="com.cloud.event.ActionEventInterceptor" />
-  <bean id="instantiatePostProcessor" class="com.cloud.utils.component.ComponentInstantiationPostProcessor">
-    <property name="Interceptors">
-        <list>
-            <ref bean="transactionContextBuilder" />
-            <ref bean="actionEventInterceptor" />
-        </list>
-    </property>
-  </bean>
-
+  <bean id="actionEventInterceptor" class="com.cloud.event.ActionEventInterceptor" />
+  <bean id="instantiatePostProcessor" class="com.cloud.utils.component.ComponentInstantiationPostProcessor">
+    <property name="Interceptors">
+        <list>
+            <ref bean="transactionContextBuilder" />
+            <ref bean="actionEventInterceptor" />
+        </list>
+    </property>
+  </bean>
+
   <bean id="TestConfiguration" 
     class="com.cloud.snapshot.SnapshotDaoTestConfiguration" />
   <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor" >

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cb4ac1f9/server/test/resources/StoragePoolDaoTestContext.xml
----------------------------------------------------------------------
diff --git a/server/test/resources/StoragePoolDaoTestContext.xml b/server/test/resources/StoragePoolDaoTestContext.xml
index 345827e..55d9623 100644
--- a/server/test/resources/StoragePoolDaoTestContext.xml
+++ b/server/test/resources/StoragePoolDaoTestContext.xml
@@ -23,19 +23,19 @@
   <context:annotation-config />
 
   <!-- @DB support -->
-  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
+  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
 
   <bean id="transactionContextBuilder" class="com.cloud.utils.db.TransactionContextBuilder" />
-  <bean id="actionEventInterceptor" class="com.cloud.event.ActionEventInterceptor" />
-  <bean id="instantiatePostProcessor" class="com.cloud.utils.component.ComponentInstantiationPostProcessor">
-    <property name="Interceptors">
-        <list>
-            <ref bean="transactionContextBuilder" />
-            <ref bean="actionEventInterceptor" />
-        </list>
-    </property>
-  </bean>
-
+  <bean id="actionEventInterceptor" class="com.cloud.event.ActionEventInterceptor" />
+  <bean id="instantiatePostProcessor" class="com.cloud.utils.component.ComponentInstantiationPostProcessor">
+    <property name="Interceptors">
+        <list>
+            <ref bean="transactionContextBuilder" />
+            <ref bean="actionEventInterceptor" />
+        </list>
+    </property>
+  </bean>
+
   <bean id="TestConfiguration" 
     class="com.cloud.storage.dao.StoragePoolDaoTestConfiguration" />
   <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor" >

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cb4ac1f9/server/test/resources/VpcApiUnitTestContext.xml
----------------------------------------------------------------------
diff --git a/server/test/resources/VpcApiUnitTestContext.xml b/server/test/resources/VpcApiUnitTestContext.xml
index 1dc1122..c9dda1a 100644
--- a/server/test/resources/VpcApiUnitTestContext.xml
+++ b/server/test/resources/VpcApiUnitTestContext.xml
@@ -24,19 +24,19 @@
   <context:component-scan base-package="org.apache.cloudstack, com.cloud" />
 
   <!-- @DB support -->
-  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
+  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
 
   <bean id="transactionContextBuilder" class="com.cloud.utils.db.TransactionContextBuilder" />
-  <bean id="actionEventInterceptor" class="com.cloud.event.ActionEventInterceptor" />
-  <bean id="instantiatePostProcessor" class="com.cloud.utils.component.ComponentInstantiationPostProcessor">
-    <property name="Interceptors">
-        <list>
-            <ref bean="transactionContextBuilder" />
-            <ref bean="actionEventInterceptor" />
-        </list>
-    </property>
-  </bean>
-
+  <bean id="actionEventInterceptor" class="com.cloud.event.ActionEventInterceptor" />
+  <bean id="instantiatePostProcessor" class="com.cloud.utils.component.ComponentInstantiationPostProcessor">
+    <property name="Interceptors">
+        <list>
+            <ref bean="transactionContextBuilder" />
+            <ref bean="actionEventInterceptor" />
+        </list>
+    </property>
+  </bean>
+
   <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor">
     <property name="requiredParameterValue" value="false" />
   </bean>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cb4ac1f9/server/test/resources/VpcTestContext.xml
----------------------------------------------------------------------
diff --git a/server/test/resources/VpcTestContext.xml b/server/test/resources/VpcTestContext.xml
index 5303736..2a52ae3 100644
--- a/server/test/resources/VpcTestContext.xml
+++ b/server/test/resources/VpcTestContext.xml
@@ -22,19 +22,19 @@
 
   <context:annotation-config />
 
-    <!-- @DB support -->
-  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
+    <!-- @DB support -->
+  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
 
-  <bean id="transactionContextBuilder" class="com.cloud.utils.db.TransactionContextBuilder" />
-  <bean id="actionEventInterceptor" class="com.cloud.event.ActionEventInterceptor" />
-  <bean id="instantiatePostProcessor" class="com.cloud.utils.component.ComponentInstantiationPostProcessor">
-    <property name="Interceptors">
-        <list>
-            <ref bean="transactionContextBuilder" />
-            <ref bean="actionEventInterceptor" />
-        </list>
-    </property>
-  </bean>
+  <bean id="transactionContextBuilder" class="com.cloud.utils.db.TransactionContextBuilder" />
+  <bean id="actionEventInterceptor" class="com.cloud.event.ActionEventInterceptor" />
+  <bean id="instantiatePostProcessor" class="com.cloud.utils.component.ComponentInstantiationPostProcessor">
+    <property name="Interceptors">
+        <list>
+            <ref bean="transactionContextBuilder" />
+            <ref bean="actionEventInterceptor" />
+        </list>
+    </property>
+  </bean>
 
   <!--
       Network Elements

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cb4ac1f9/server/test/resources/createNetworkOffering.xml
----------------------------------------------------------------------
diff --git a/server/test/resources/createNetworkOffering.xml b/server/test/resources/createNetworkOffering.xml
index 90342c5..1f31205 100644
--- a/server/test/resources/createNetworkOffering.xml
+++ b/server/test/resources/createNetworkOffering.xml
@@ -1,46 +1,46 @@
-<!-- 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. -->
-<beans xmlns="http://www.springframework.org/schema/beans"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
-  xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans
-                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-                      http://www.springframework.org/schema/tx 
-                      http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
-                      http://www.springframework.org/schema/aop
-                      http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
-                      http://www.springframework.org/schema/context
-                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
-
-     <context:annotation-config />
-
-    <!-- @DB support -->
-      
-  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
-
-  <bean id="transactionContextBuilder" class="com.cloud.utils.db.TransactionContextBuilder" />
-  <bean id="actionEventInterceptor" class="com.cloud.event.ActionEventInterceptor" />
-  <bean id="instantiatePostProcessor" class="com.cloud.utils.component.ComponentInstantiationPostProcessor">
-    <property name="Interceptors">
-        <list>
-            <ref bean="transactionContextBuilder" />
-            <ref bean="actionEventInterceptor" />
-        </list>
-    </property>
-  </bean>
-
-    <bean id="ConfigurationManager" class="com.cloud.configuration.ConfigurationManagerImpl">
-        <property name="name" value="ConfigurationManager"/>
-    </bean>
-  
-    <bean class="org.apache.cloudstack.networkoffering.ChildTestConfiguration" />
-    
-</beans>
+<!-- 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. -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+  xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/tx
+                      http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
+                      http://www.springframework.org/schema/aop
+                      http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+     <context:annotation-config />
+
+    <!-- @DB support -->
+
+  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
+
+  <bean id="transactionContextBuilder" class="com.cloud.utils.db.TransactionContextBuilder" />
+  <bean id="actionEventInterceptor" class="com.cloud.event.ActionEventInterceptor" />
+  <bean id="instantiatePostProcessor" class="com.cloud.utils.component.ComponentInstantiationPostProcessor">
+    <property name="Interceptors">
+        <list>
+            <ref bean="transactionContextBuilder" />
+            <ref bean="actionEventInterceptor" />
+        </list>
+    </property>
+  </bean>
+
+    <bean id="ConfigurationManager" class="com.cloud.configuration.ConfigurationManagerImpl">
+        <property name="name" value="ConfigurationManager"/>
+    </bean>
+
+    <bean class="org.apache.cloudstack.networkoffering.ChildTestConfiguration" />
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cb4ac1f9/server/test/resources/testContext.xml
----------------------------------------------------------------------
diff --git a/server/test/resources/testContext.xml b/server/test/resources/testContext.xml
index 6a21198..c363955 100644
--- a/server/test/resources/testContext.xml
+++ b/server/test/resources/testContext.xml
@@ -37,19 +37,19 @@
   <!--
     @DB support
   -->
-  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
+  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
 
   <bean id="transactionContextBuilder" class="com.cloud.utils.db.TransactionContextBuilder" />
   <bean id="actionEventInterceptor" class="com.cloud.event.ActionEventInterceptor" />
-  <bean id="instantiatePostProcessor" class="com.cloud.utils.component.ComponentInstantiationPostProcessor">
-    <property name="Interceptors">
-        <list>
-            <ref bean="transactionContextBuilder" />
-            <ref bean="actionEventInterceptor" />
-        </list>
-    </property>
-  </bean>
-  
+  <bean id="instantiatePostProcessor" class="com.cloud.utils.component.ComponentInstantiationPostProcessor">
+    <property name="Interceptors">
+        <list>
+            <ref bean="transactionContextBuilder" />
+            <ref bean="actionEventInterceptor" />
+        </list>
+    </property>
+  </bean>
+
   <bean class="com.cloud.network.security.SecurityGroupManagerTestConfiguration" />
 
   <!--


[49/50] [abbrv] Merge branch 'marvin-refactor' into marvin_refactor

Posted by ts...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2a990642/tools/marvin/marvin/integration/lib/oldbase.py
----------------------------------------------------------------------
diff --cc tools/marvin/marvin/integration/lib/oldbase.py
index 0000000,5454237..9b2157f
mode 000000,100644..100644
--- a/tools/marvin/marvin/integration/lib/oldbase.py
+++ b/tools/marvin/marvin/integration/lib/oldbase.py
@@@ -1,0 -1,2424 +1,2426 @@@
+ # 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.
+ 
+ """ Base class for all Cloudstack resources
+     -Virtual machine, Volume, Snapshot etc
+ """
+ 
+ import marvin
+ from utils import is_server_ssh_ready, random_gen
+ from marvin.cloudstackAPI import *
+ #Import System modules
+ import time
+ import hashlib
+ import base64
+ 
+ 
+ class Domain:
+     """ Domain Life Cycle """
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services, name=None, networkdomain=None,
+                parentdomainid=None):
+         """Creates an domain"""
+ 
+         cmd = createDomain.createDomainCmd()
+ 
+         if name:
+             cmd.name = "-".join([name, random_gen()])
+         elif "name" in services:
+             cmd.name = "-".join([services["name"], random_gen()])
+ 
+         if networkdomain:
+             cmd.networkdomain = networkdomain
+         elif "networkdomain" in services:
+             cmd.networkdomain = services["networkdomain"]
+ 
+         if parentdomainid:
+             cmd.parentdomainid = parentdomainid
+         elif "parentdomainid" in services:
+             cmd.parentdomainid = services["parentdomainid"]
+ 
+         return Domain(apiclient.createDomain(cmd).__dict__)
+ 
+     def delete(self, apiclient, cleanup=None):
+         """Delete an domain"""
+         cmd = deleteDomain.deleteDomainCmd()
+         cmd.id = self.id
+         if cleanup:
+             cmd.cleanup = cleanup
+         apiclient.deleteDomain(cmd)
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """Lists domains"""
+         cmd = listDomains.listDomainsCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listDomains(cmd))
+ 
+ 
+ class Account:
+     """ Account Life Cycle """
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services, admin=False, domainid=None):
+         """Creates an account"""
+         cmd = createAccount.createAccountCmd()
+ 
+         #0 - User, 1 - Root Admin, 2 - Domain Admin
+         cmd.accounttype = 2 if (admin and domainid) else int(admin)
+ 
+         cmd.email = services["email"]
+         cmd.firstname = services["firstname"]
+         cmd.lastname = services["lastname"]
+ 
+         # Password Encoding
+         mdf = hashlib.md5()
+         mdf.update(services["password"])
+         cmd.password = mdf.hexdigest()
+         cmd.username = "-".join([services["username"], random_gen()])
+ 
+         if domainid:
+             cmd.domainid = domainid
+         account = apiclient.createAccount(cmd)
+ 
+         return Account(account.__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete an account"""
+         cmd = deleteAccount.deleteAccountCmd()
+         cmd.id = self.account.id
+         apiclient.deleteAccount(cmd)
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """Lists accounts and provides detailed account information for
+         listed accounts"""
+ 
+         cmd = listAccounts.listAccountsCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listAccounts(cmd))
+ 
+ 
+ class User:
+     """ User Life Cycle """
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services, account, domainid):
+         cmd = createUser.createUserCmd()
+         """Creates an user"""
+ 
+         cmd.account = account
+         cmd.domainid = domainid
+         cmd.email = services["email"]
+         cmd.firstname = services["firstname"]
+         cmd.lastname = services["lastname"]
+ 
+         # Password Encoding
+         mdf = hashlib.md5()
+         mdf.update(services["password"])
+         cmd.password = mdf.hexdigest()
+         cmd.username = "-".join([services["username"], random_gen()])
+         user = apiclient.createUser(cmd)
+ 
+         return User(user.__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete an account"""
+         cmd = deleteUser.deleteUserCmd()
+         cmd.id = self.id
+         apiclient.deleteUser(cmd)
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """Lists users and provides detailed account information for
+         listed users"""
+ 
+         cmd = listUsers.listUsersCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listUsers(cmd))
+ 
+     @classmethod
+     def registerUserKeys(cls, apiclient, userid):
+         cmd = registerUserKeys.registerUserKeysCmd()
+         cmd.id = userid
+         return apiclient.registerUserKeys(cmd)
+ 
+     def update(self, apiclient, **kwargs):
+         """Updates the user details"""
+ 
+         cmd = updateUser.updateUserCmd()
+         cmd.id = self.id
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return (apiclient.updateUser(cmd))
+ 
+     @classmethod
+     def update(cls, apiclient, id, **kwargs):
+         """Updates the user details (class method)"""
+ 
+         cmd = updateUser.updateUserCmd()
+         cmd.id = id
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return (apiclient.updateUser(cmd))
+ 
+     @classmethod
+     def login(cls, apiclient, username, password, domain=None, domainid=None):
+         """Logins to the CloudStack"""
+ 
+         cmd = login.loginCmd()
+         cmd.username = username
+         # MD5 hashcoded password
+         mdf = hashlib.md5()
+         mdf.update(password)
+         cmd.password = mdf.hexdigest()
+         if domain:
+             cmd.domain = domain
+         if domainid:
+             cmd.domainid = domainid
+         return apiclient.login(cmd)
+ 
+ 
+ class VirtualMachine:
+     """Manage virtual machine lifecycle"""
+ 
+     def __init__(self, items, services):
+         self.__dict__.update(items)
+         if "username" in services:
+             self.username = services["username"]
+         else:
+             self.username = 'root'
+         if "password" in services:
+             self.password = services["password"]
+         else:
+             self.password = 'password'
+         if "ssh_port" in services:
+             self.ssh_port = services["ssh_port"]
+         else:
+             self.ssh_port = 22
+         self.ssh_client = None
+         #extract out the ipaddress
+         self.ipaddress = self.nic[0].ipaddress
+ 
+     @classmethod
+     def create(cls, apiclient, services, templateid=None, accountid=None,
+                     domainid=None, zoneid=None, networkids=None, serviceofferingid=None,
+                     securitygroupids=None, projectid=None, startvm=None,
+                     diskofferingid=None, hostid=None, mode='basic'):
+         """Create the instance"""
+ 
+         cmd = deployVirtualMachine.deployVirtualMachineCmd()
+ 
+         if serviceofferingid:
+             cmd.serviceofferingid = serviceofferingid
+         elif "serviceoffering" in services:
+             cmd.serviceofferingid = services["serviceoffering"]
+ 
+         if zoneid:
+             cmd.zoneid = zoneid
+         elif "zoneid" in services:
+             cmd.zoneid = services["zoneid"]
+         cmd.hypervisor = services["hypervisor"]
+ 
+         if accountid:
+             cmd.account = accountid
+         elif "account" in services:
+             cmd.account = services["account"]
+ 
+         if domainid:
+             cmd.domainid = domainid
+         elif "domainid" in services:
+             cmd.domainid = services["domainid"]
+ 
+         if networkids:
+             cmd.networkids = networkids
+         elif "networkids" in services:
+             cmd.networkids = services["networkids"]
+ 
+         if templateid:
+             cmd.templateid = templateid
+         elif "template" in services:
+             cmd.templateid = services["template"]
+ 
+         if "diskoffering" in services:
+             cmd.diskofferingid = services["diskoffering"]
+ 
+         if securitygroupids:
+             cmd.securitygroupids = [str(sg_id) for sg_id in securitygroupids]
+ 
+         if "userdata" in services:
+             cmd.userdata = base64.b64encode(services["userdata"])
+ 
+         if projectid:
+             cmd.projectid = projectid
+ 
+         if startvm is not None:
+             cmd.startvm = startvm
+ 
+         if hostid:
+             cmd.hostid = hostid
+ 
+         virtual_machine = apiclient.deployVirtualMachine(cmd)
+ 
+         # VM should be in Running state after deploy
+         timeout = 10
+         while True:
+             vm_status = VirtualMachine.list(
+                                             apiclient,
+                                             id=virtual_machine.id
+                                             )
+             if isinstance(vm_status, list):
+                 if vm_status[0].state == 'Running':
+                     break
+                 elif timeout == 0:
+                     raise Exception(
+                             "TimeOutException: Failed to start VM (ID: %s)" %
+                                                         virtual_machine.id)
+ 
+             time.sleep(10)
+             timeout = timeout - 1
+ 
+         if mode.lower() == 'advanced':
+             public_ip = PublicIPAddress.create(
+                                            apiclient,
+                                            virtual_machine.account,
+                                            virtual_machine.zoneid,
+                                            virtual_machine.domainid,
+                                            services
+                                            )
+             fw_rule = FireWallRule.create(
+                                           apiclient,
+                                           ipaddressid=public_ip.ipaddress.id,
+                                           protocol='TCP',
+                                           cidrlist=['0.0.0.0/0'],
+                                           startport=22,
+                                           endport=22
+                             )
+             nat_rule = NATRule.create(
+                                     apiclient,
+                                     virtual_machine,
+                                     services,
+                                     ipaddressid=public_ip.ipaddress.id
+                                     )
+             virtual_machine.ssh_ip = nat_rule.ipaddress
+             virtual_machine.public_ip = nat_rule.ipaddress
+         else:
+             virtual_machine.ssh_ip = virtual_machine.nic[0].ipaddress
+             virtual_machine.public_ip = virtual_machine.nic[0].ipaddress
+ 
+         return VirtualMachine(virtual_machine.__dict__, services)
+ 
+     def start(self, apiclient):
+         """Start the instance"""
+         cmd = startVirtualMachine.startVirtualMachineCmd()
+         cmd.id = self.id
+         apiclient.startVirtualMachine(cmd)
+ 
+     def stop(self, apiclient):
+         """Stop the instance"""
+         cmd = stopVirtualMachine.stopVirtualMachineCmd()
+         cmd.id = self.id
+         apiclient.stopVirtualMachine(cmd)
+ 
+     def reboot(self, apiclient):
+         """Reboot the instance"""
+         cmd = rebootVirtualMachine.rebootVirtualMachineCmd()
+         cmd.id = self.id
+         apiclient.rebootVirtualMachine(cmd)
+ 
+     def get_ssh_client(self, ipaddress=None, reconnect=False, port=None):
+         """Get SSH object of VM"""
+ 
+         # If NAT Rules are not created while VM deployment in Advanced mode
+         # then, IP address must be passed
+         if ipaddress != None:
+             self.ssh_ip = ipaddress
+         if port:
+             self.ssh_port = port
+ 
+         if reconnect:
+             self.ssh_client = is_server_ssh_ready(
+                                                     self.ssh_ip,
+                                                     self.ssh_port,
+                                                     self.username,
+                                                     self.password
+                                                 )
+         self.ssh_client = self.ssh_client or is_server_ssh_ready(
+                                                     self.ssh_ip,
+                                                     self.ssh_port,
+                                                     self.username,
+                                                     self.password
+                                                 )
+         return self.ssh_client
+ 
+     def delete(self, apiclient):
+         """Destroy an Instance"""
+         cmd = destroyVirtualMachine.destroyVirtualMachineCmd()
+         cmd.id = self.id
+         apiclient.destroyVirtualMachine(cmd)
+ 
+     def attach_volume(self, apiclient, volume):
+         """Attach volume to instance"""
+         cmd = attachVolume.attachVolumeCmd()
+         cmd.id = volume.id
+         cmd.virtualmachineid = self.id
+         return apiclient.attachVolume(cmd)
+ 
+     def detach_volume(self, apiclient, volume):
+         """Detach volume to instance"""
+         cmd = detachVolume.detachVolumeCmd()
+         cmd.id = volume.id
+         return apiclient.detachVolume(cmd)
+ 
+     def add_nic(self, apiclient, networkId):
+         """Add a NIC to a VM"""
+         cmd = addNicToVirtualMachine.addNicToVirtualMachineCmd();
+         cmd.virtualmachineid = self.id
+         cmd.networkid = networkId
+         return apiclient.addNicToVirtualMachine(cmd)
+ 
+     def remove_nic(self, apiclient, nicId):
+         """Remove a NIC to a VM"""
+         cmd = removeNicFromVirtualMachine.removeNicFromVirtualMachineCmd()
+         cmd.nicid = nicId
+         cmd.virtualmachineid = self.id
+         return apiclient.removeNicFromVirtualMachine(cmd)
+ 
+     def update_default_nic(self, apiclient, nicId):
+         """Set a NIC to be the default network adapter for a VM"""
+         cmd = updateDefaultNicForVirtualMachine.updateDefaultNicForVirtualMachineCmd()
+         cmd.nicid = nicId
+         cmd.virtualmachineid = self.id
+         return apiclient.updateDefaultNicForVirtualMachine(cmd)
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """List all VMs matching criteria"""
+ 
+         cmd = listVirtualMachines.listVirtualMachinesCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listVirtualMachines(cmd))
+ 
+     def resetPassword(self, apiclient):
+         """Resets VM password if VM created using password enabled template"""
+ 
+         cmd = resetPasswordForVirtualMachine.resetPasswordForVirtualMachineCmd()
+         cmd.id = self.id
+         try:
+             response = apiclient.resetPasswordForVirtualMachine(cmd)
+             print response
+         except Exception as e:
+             raise Exception("Reset Password failed! - %s" % e)
+         print type(response)
+         if isinstance(response, list):
+             return response[0].password
+ 
+ 
+ class Volume:
+     """Manage Volume Lifecycle
+     """
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services, zoneid=None, account=None,
+                domainid=None, diskofferingid=None, projectid=None):
+         """Create Volume"""
+         cmd = createVolume.createVolumeCmd()
+         cmd.name = services["diskname"]
+ 
+         if diskofferingid:
+             cmd.diskofferingid = diskofferingid
+         elif "diskofferingid" in services:
+             cmd.diskofferingid = services["diskofferingid"]
+ 
+         if zoneid:
+             cmd.zoneid = zoneid
+         elif "zoneid" in services:
+             cmd.zoneid = services["zoneid"]
+ 
+         if account:
+             cmd.account = account
+         elif "account" in services:
+             cmd.account = services["account"]
+ 
+         if domainid:
+             cmd.domainid = domainid
+         elif "domainid" in services:
+             cmd.domainid = services["domainid"]
+ 
+         if projectid:
+             cmd.projectid = projectid
+         return Volume(apiclient.createVolume(cmd).__dict__)
+ 
+     @classmethod
+     def create_custom_disk(cls, apiclient, services, account=None,
+                                     domainid=None, diskofferingid=None):
+         """Create Volume from Custom disk offering"""
+         cmd = createVolume.createVolumeCmd()
+         cmd.name = services["diskname"]
+ 
+         if diskofferingid:
+             cmd.diskofferingid = diskofferingid
+         elif "customdiskofferingid" in services:
+             cmd.diskofferingid = services["customdiskofferingid"]
+ 
+         cmd.size = services["customdisksize"]
+         cmd.zoneid = services["zoneid"]
+ 
+         if account:
+             cmd.account = account
+         else:
+             cmd.account = services["account"]
+ 
+         if domainid:
+             cmd.domainid = domainid
+         else:
+             cmd.domainid = services["domainid"]
+ 
+         return Volume(apiclient.createVolume(cmd).__dict__)
+ 
+     @classmethod
+     def create_from_snapshot(cls, apiclient, snapshot_id, services,
+                              account=None, domainid=None):
+         """Create Volume from snapshot"""
+         cmd = createVolume.createVolumeCmd()
+         cmd.name = "-".join([services["diskname"], random_gen()])
+         cmd.snapshotid = snapshot_id
+         cmd.zoneid = services["zoneid"]
+         cmd.size = services["size"]
+         if account:
+             cmd.account = account
+         else:
+             cmd.account = services["account"]
+         if domainid:
+             cmd.domainid = domainid
+         else:
+             cmd.domainid = services["domainid"]
+         return Volume(apiclient.createVolume(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete Volume"""
+         cmd = deleteVolume.deleteVolumeCmd()
+         cmd.id = self.id
+         apiclient.deleteVolume(cmd)
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """List all volumes matching criteria"""
+ 
+         cmd = listVolumes.listVolumesCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listVolumes(cmd))
+ 
+     def resize(cls, apiclient, **kwargs):
+         """Resize a volume"""
+         cmd = resizeVolume.resizeVolumeCmd()
+         cmd.id = self.id
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.resizeVolume(cmd))
+ 
+ class Snapshot:
+     """Manage Snapshot Lifecycle
+     """
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, volume_id, account=None,
+                                             domainid=None, projectid=None):
+         """Create Snapshot"""
+         cmd = createSnapshot.createSnapshotCmd()
+         cmd.volumeid = volume_id
+         if account:
+             cmd.account = account
+         if domainid:
+             cmd.domainid = domainid
+         if projectid:
+             cmd.projectid = projectid
+         return Snapshot(apiclient.createSnapshot(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete Snapshot"""
+         cmd = deleteSnapshot.deleteSnapshotCmd()
+         cmd.id = self.id
+         apiclient.deleteSnapshot(cmd)
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """List all snapshots matching criteria"""
+ 
+         cmd = listSnapshots.listSnapshotsCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listSnapshots(cmd))
+ 
+ 
+ class Template:
+     """Manage template life cycle"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services, volumeid=None,
+                account=None, domainid=None, projectid=None):
+         """Create template from Volume"""
+         #Create template from Virtual machine and Volume ID
+         cmd = createTemplate.createTemplateCmd()
+         cmd.displaytext = services["displaytext"]
+         cmd.name = "-".join([services["name"], random_gen()])
+         if "ostypeid" in services:
+             cmd.ostypeid = services["ostypeid"]
+         elif "ostype" in services:
+             # Find OSTypeId from Os type
+             sub_cmd = listOsTypes.listOsTypesCmd()
+             sub_cmd.description = services["ostype"]
+             ostypes = apiclient.listOsTypes(sub_cmd)
+ 
+             if not isinstance(ostypes, list):
+                 raise Exception(
+                     "Unable to find Ostype id with desc: %s" %
+                                                 services["ostype"])
+             cmd.ostypeid = ostypes[0].id
+         else:
+             raise Exception(
+                     "Unable to find Ostype is required for creating template")
+ 
+         cmd.isfeatured = services["isfeatured"] if "isfeatured" in services else False
+         cmd.ispublic = services["ispublic"] if "ispublic" in services else False
+         cmd.isextractable = services["isextractable"] if "isextractable" in services else False
+         cmd.passwordenabled = services["passwordenabled"] if "passwordenabled" in services else False
+         cmd.passwordenabled = services["passwordenabled"] if "passwordenabled" in services else False
+ 
+         if volumeid:
+             cmd.volumeid = volumeid
+ 
+         if account:
+             cmd.account = account
+ 
+         if domainid:
+             cmd.domainid = domainid
+ 
+         if projectid:
+             cmd.projectid = projectid
+         return Template(apiclient.createTemplate(cmd).__dict__)
+ 
+     @classmethod
+     def register(cls, apiclient, services, zoneid=None,
+                                                 account=None, domainid=None):
+         """Create template from URL"""
+ 
+         #Create template from Virtual machine and Volume ID
+         cmd = registerTemplate.registerTemplateCmd()
+         cmd.displaytext = services["displaytext"]
+         cmd.name = "-".join([services["name"], random_gen()])
+         cmd.format = services["format"]
+         cmd.hypervisor = services["hypervisor"]
+ 
+         if "ostypeid" in services:
+             cmd.ostypeid = services["ostypeid"]
+         elif "ostype" in services:
+             # Find OSTypeId from Os type
+             sub_cmd = listOsTypes.listOsTypesCmd()
+             sub_cmd.description = services["ostype"]
+             ostypes = apiclient.listOsTypes(sub_cmd)
+ 
+             if not isinstance(ostypes, list):
+                 raise Exception(
+                     "Unable to find Ostype id with desc: %s" %
+                                                 services["ostype"])
+             cmd.ostypeid = ostypes[0].id
+         else:
+             raise Exception(
+                     "Unable to find Ostype is required for registering template")
+ 
+         cmd.url = services["url"]
+ 
+         if zoneid:
+             cmd.zoneid = zoneid
+         else:
+             cmd.zoneid = services["zoneid"]
+ 
+         cmd.isfeatured = services["isfeatured"] if "isfeatured" in services else False
+         cmd.ispublic = services["ispublic"] if "ispublic" in services else False
+         cmd.isextractable = services["isextractable"] if "isextractable" in services else False
+         cmd.passwordenabled = services["passwordenabled"] if "passwordenabled" in services else False
+ 
+         if account:
+             cmd.account = account
+ 
+         if domainid:
+             cmd.domainid = domainid
+ 
+         # Register Template
+         template = apiclient.registerTemplate(cmd)
+ 
+         if isinstance(template, list):
+             return Template(template[0].__dict__)
+ 
+     @classmethod
+     def create_from_snapshot(cls, apiclient, snapshot, services,
+                                                         random_name=True):
+         """Create Template from snapshot"""
+         #Create template from Virtual machine and Snapshot ID
+         cmd = createTemplate.createTemplateCmd()
+         cmd.displaytext = services["displaytext"]
+         cmd.name = "-".join([
+                              services["name"],
+                              random_gen()
+                             ]) if random_name else services["name"]
+ 
+         if "ostypeid" in services:
+             cmd.ostypeid = services["ostypeid"]
+         elif "ostype" in services:
+             # Find OSTypeId from Os type
+             sub_cmd = listOsTypes.listOsTypesCmd()
+             sub_cmd.description = services["ostype"]
+             ostypes = apiclient.listOsTypes(sub_cmd)
+ 
+             if not isinstance(ostypes, list):
+                 raise Exception(
+                     "Unable to find Ostype id with desc: %s" %
+                                                 services["ostype"])
+             cmd.ostypeid = ostypes[0].id
+         else:
+             raise Exception(
+                     "Unable to find Ostype is required for creating template")
+ 
+         cmd.snapshotid = snapshot.id
+         return Template(apiclient.createTemplate(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete Template"""
+ 
+         cmd = deleteTemplate.deleteTemplateCmd()
+         cmd.id = self.id
+         apiclient.deleteTemplate(cmd)
+ 
+     def download(self, apiclient, timeout=5, interval=60):
+         """Download Template"""
+         #Sleep to ensure template is in proper state before download
+         time.sleep(interval)
+ 
+         while True:
+             template_response = Template.list(
+                                     apiclient,
+                                     id=self.id,
+                                     zoneid=self.zoneid,
+                                     templatefilter='self'
+                                     )
+             if isinstance(template_response, list):
+ 
+                 template = template_response[0]
+                 # If template is ready,
+                 # template.status = Download Complete
+                 # Downloading - x% Downloaded
+                 # Error - Any other string
+                 if template.status == 'Download Complete':
+                     break
+ 
+                 elif 'Downloaded' in template.status:
+                     time.sleep(interval)
+ 
+                 elif 'Installing' not in template.status:
+                     raise Exception(
+                         "Error in downloading template: status - %s" %
+                                                             template.status)
+ 
+             elif timeout == 0:
+                 break
+ 
+             else:
+                 time.sleep(interval)
+                 timeout = timeout - 1
+         return
+ 
+     def updatePermissions(self, apiclient, **kwargs):
+         """Updates the template permissions"""
+ 
+         cmd = updateTemplatePermissions.updateTemplatePermissionsCmd()
+         cmd.id = self.id
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.updateTemplatePermissions(cmd))
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """List all templates matching criteria"""
+ 
+         cmd = listTemplates.listTemplatesCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listTemplates(cmd))
+ 
+ 
+ class Iso:
+     """Manage ISO life cycle"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services, account=None, domainid=None,
+                                                         projectid=None):
+         """Create an ISO"""
+         #Create ISO from URL
+         cmd = registerIso.registerIsoCmd()
+         cmd.displaytext = services["displaytext"]
+         cmd.name = services["name"]
+         if "ostypeid" in services:
+             cmd.ostypeid = services["ostypeid"]
+         elif "ostype" in services:
+             # Find OSTypeId from Os type
+             sub_cmd = listOsTypes.listOsTypesCmd()
+             sub_cmd.description = services["ostype"]
+             ostypes = apiclient.listOsTypes(sub_cmd)
+ 
+             if not isinstance(ostypes, list):
+                 raise Exception(
+                     "Unable to find Ostype id with desc: %s" %
+                                                 services["ostype"])
+             cmd.ostypeid = ostypes[0].id
+         else:
+             raise Exception(
+                     "Unable to find Ostype is required for creating ISO")
+ 
+         cmd.url = services["url"]
+         cmd.zoneid = services["zoneid"]
+ 
+         if "isextractable" in services:
+             cmd.isextractable = services["isextractable"]
+         if "isfeatured" in services:
+             cmd.isfeatured = services["isfeatured"]
+         if "ispublic" in services:
+             cmd.ispublic = services["ispublic"]
+ 
+         if account:
+             cmd.account = account
+         if domainid:
+             cmd.domainid = domainid
+         if projectid:
+             cmd.projectid = projectid
+         # Register ISO
+         iso = apiclient.registerIso(cmd)
+ 
+         if iso:
+             return Iso(iso[0].__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete an ISO"""
+         cmd = deleteIso.deleteIsoCmd()
+         cmd.id = self.id
+         apiclient.deleteIso(cmd)
+         return
+ 
+     def download(self, apiclient, timeout=5, interval=60):
+         """Download an ISO"""
+         #Ensuring ISO is successfully downloaded
+         while True:
+             time.sleep(interval)
+ 
+             cmd = listIsos.listIsosCmd()
+             cmd.id = self.id
+             iso_response = apiclient.listIsos(cmd)
+ 
+             if isinstance(iso_response, list):
+                 response = iso_response[0]
+                 # Again initialize timeout to avoid listISO failure
+                 timeout = 5
+                 print response.status
+                 # Check whether download is in progress(for Ex:10% Downloaded)
+                 # or ISO is 'Successfully Installed'
+                 if response.status == 'Successfully Installed':
+                     return
+                 elif 'Downloaded' not in response.status and \
+                     'Installing' not in response.status:
+                     raise Exception(
+                         "Error In Downloading ISO: ISO Status - %s" %
+                                                             response.status)
+ 
+             elif timeout == 0:
+                 raise Exception("ISO download Timeout Exception")
+             else:
+                 timeout = timeout - 1
+         return
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """Lists all available ISO files."""
+ 
+         cmd = listIsos.listIsosCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listIsos(cmd))
+ 
+ 
+ class PublicIPAddress:
+     """Manage Public IP Addresses"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, accountid=None, zoneid=None, domainid=None,
+                services=None, networkid=None, projectid=None, vpcid=None):
+         """Associate Public IP address"""
+         cmd = associateIpAddress.associateIpAddressCmd()
+ 
+         if accountid:
+             cmd.account = accountid
++        elif "account" in services:
++            cmd.account = services["account"]
+ 
+         if zoneid:
+             cmd.zoneid = zoneid
+         elif "zoneid" in services:
+             cmd.zoneid = services["zoneid"]
+ 
+         if domainid:
+             cmd.domainid = domainid
+         elif "domainid" in services:
+             cmd.domainid = services["domainid"]
+ 
+         if networkid:
+             cmd.networkid = networkid
+ 
+         if projectid:
+             cmd.projectid = projectid
+ 
+         if vpcid:
+             cmd.vpcid = vpcid
+         return PublicIPAddress(apiclient.associateIpAddress(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Dissociate Public IP address"""
+         cmd = disassociateIpAddress.disassociateIpAddressCmd()
+         cmd.id = self.ipaddress.id
+         apiclient.disassociateIpAddress(cmd)
+         return
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """List all Public IPs matching criteria"""
+ 
+         cmd = listPublicIpAddresses.listPublicIpAddressesCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listPublicIpAddresses(cmd))
+ 
+ 
+ class NATRule:
+     """Manage port forwarding rule"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, virtual_machine, services, ipaddressid=None,
+                                                             projectid=None, networkid=None):
+         """Create Port forwarding rule"""
+         cmd = createPortForwardingRule.createPortForwardingRuleCmd()
+ 
+         if ipaddressid:
+             cmd.ipaddressid = ipaddressid
+         elif "ipaddressid" in services:
+             cmd.ipaddressid = services["ipaddressid"]
+ 
+         cmd.privateport = services["privateport"]
+         cmd.publicport = services["publicport"]
+         cmd.protocol = services["protocol"]
+         cmd.virtualmachineid = virtual_machine.id
+ 
+         if projectid:
+             cmd.projectid = projectid
+ 
+         if networkid:
+             cmd.networkid = networkid
+ 
+         return NATRule(apiclient.createPortForwardingRule(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete port forwarding"""
+         cmd = deletePortForwardingRule.deletePortForwardingRuleCmd()
+         cmd.id = self.id
+         apiclient.deletePortForwardingRule(cmd)
+         return
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """List all NAT rules matching criteria"""
+ 
+         cmd = listPortForwardingRules.listPortForwardingRulesCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listPortForwardingRules(cmd))
+ 
+ 
+ class StaticNATRule:
+     """Manage Static NAT rule"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services, ipaddressid=None, vpcid=None):
+         """Creates static ip forwarding rule"""
+ 
+         cmd = createIpForwardingRule.createIpForwardingRuleCmd()
+         cmd.protocol = services["protocol"]
+         cmd.startport = services["startport"]
+ 
+         if "endport" in services:
+             cmd.endport = services["endport"]
+ 
+         if "cidrlist" in services:
+             cmd.cidrlist = services["cidrlist"]
+ 
+         if ipaddressid:
+             cmd.ipaddressid = ipaddressid
+         elif "ipaddressid" in services:
+             cmd.ipaddressid = services["ipaddressid"]
+ 
+         if vpcid:
+             cmd.vpcid = vpcid
+ 
+         return StaticNATRule(apiclient.createIpForwardingRule(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete IP forwarding rule"""
+         cmd = deleteIpForwardingRule.deleteIpForwardingRuleCmd()
+         cmd.id = self.id
+         apiclient.deleteIpForwardingRule(cmd)
+         return
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """List all IP forwarding rules matching criteria"""
+ 
+         cmd = listIpForwardingRules.listIpForwardingRulesCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listIpForwardingRules(cmd))
+ 
+     @classmethod
+     def enable(cls, apiclient, ipaddressid, virtualmachineid):
+         """Enables Static NAT rule"""
+ 
+         cmd = enableStaticNat.enableStaticNatCmd()
+         cmd.ipaddressid = ipaddressid
+         cmd.virtualmachineid = virtualmachineid
+         apiclient.enableStaticNat(cmd)
+         return
+ 
+     @classmethod
+     def disable(cls, apiclient, ipaddressid, virtualmachineid):
+         """Disables Static NAT rule"""
+ 
+         cmd = disableStaticNat.disableStaticNatCmd()
+         cmd.ipaddressid = ipaddressid
+         apiclient.disableStaticNat(cmd)
+         return
+ 
+ 
+ class FireWallRule:
+     """Manage Firewall rule"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, ipaddressid, protocol, cidrlist=None,
+                startport=None, endport=None, projectid=None, vpcid=None):
+         """Create Firewall Rule"""
+         cmd = createFirewallRule.createFirewallRuleCmd()
+         cmd.ipaddressid = ipaddressid
+         cmd.protocol = protocol
+         if cidrlist:
+             cmd.cidrlist = cidrlist
+         if startport:
+             cmd.startport = startport
+         if endport:
+             cmd.endport = endport
+ 
+         if projectid:
+             cmd.projectid = projectid
+ 
+         if vpcid:
+             cmd.vpcid = vpcid
+ 
+         return FireWallRule(apiclient.createFirewallRule(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete Firewall rule"""
+         cmd = deleteFirewallRule.deleteFirewallRuleCmd()
+         cmd.id = self.id
+         apiclient.deleteFirewallRule(cmd)
+         return
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """List all Firewall Rules matching criteria"""
+ 
+         cmd = listFirewallRules.listFirewallRulesCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listFirewallRules(cmd))
+ 
+ 
+ class ServiceOffering:
+     """Manage service offerings cycle"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services, domainid=None, **kwargs):
+         """Create Service offering"""
+         cmd = createServiceOffering.createServiceOfferingCmd()
+         cmd.cpunumber = services["cpunumber"]
+         cmd.cpuspeed = services["cpuspeed"]
+         cmd.displaytext = services["displaytext"]
+         cmd.memory = services["memory"]
+         cmd.name = services["name"]
+         if "storagetype" in services:
+             cmd.storagetype = services["storagetype"]
+ 
+         # Service Offering private to that domain
+         if domainid:
+             cmd.domainid = domainid
+ 
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return ServiceOffering(apiclient.createServiceOffering(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete Service offering"""
+         cmd = deleteServiceOffering.deleteServiceOfferingCmd()
+         cmd.id = self.id
+         apiclient.deleteServiceOffering(cmd)
+         return
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """Lists all available service offerings."""
+ 
+         cmd = listServiceOfferings.listServiceOfferingsCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listServiceOfferings(cmd))
+ 
+ 
+ class DiskOffering:
+     """Manage disk offerings cycle"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services, custom=False, domainid=None):
+         """Create Disk offering"""
+         cmd = createDiskOffering.createDiskOfferingCmd()
+         cmd.displaytext = services["displaytext"]
+         cmd.name = services["name"]
+         if custom:
+             cmd.customized = True
+         else:
+             cmd.disksize = services["disksize"]
+ 
+         if domainid:
+             cmd.domainid = domainid
+ 
+         if "storagetype" in services:
+             cmd.storagetype = services["storagetype"]
+ 
+         return DiskOffering(apiclient.createDiskOffering(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete Disk offering"""
+         cmd = deleteDiskOffering.deleteDiskOfferingCmd()
+         cmd.id = self.id
+         apiclient.deleteDiskOffering(cmd)
+         return
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """Lists all available disk offerings."""
+ 
+         cmd = listDiskOfferings.listDiskOfferingsCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listDiskOfferings(cmd))
+ 
+ 
+ class NetworkOffering:
+     """Manage network offerings cycle"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services, **kwargs):
+         """Create network offering"""
+ 
+         cmd = createNetworkOffering.createNetworkOfferingCmd()
+         cmd.displaytext = "-".join([services["displaytext"], random_gen()])
+         cmd.name = "-".join([services["name"], random_gen()])
+         cmd.guestiptype = services["guestiptype"]
+         cmd.supportedservices = services["supportedservices"]
+         cmd.traffictype = services["traffictype"]
+ 
+         cmd.serviceProviderList = []
+         for service, provider in services["serviceProviderList"].items():
+             cmd.serviceProviderList.append({
+                                             'service': service,
+                                             'provider': provider
+                                            })
+         if "servicecapabilitylist" in services:
+             cmd.servicecapabilitylist = []
+             for service, capability in services["servicecapabilitylist"].items():
+                 for ctype, value in capability.items():
+                     cmd.servicecapabilitylist.append({
+                                             'service': service,
+                                             'capabilitytype': ctype,
+                                             'capabilityvalue': value
+                                            })
+         if "specifyVlan" in services:
+             cmd.specifyVlan = services["specifyVlan"]
+         if "specifyIpRanges" in services:
+             cmd.specifyIpRanges = services["specifyIpRanges"]
+ 
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+ 
+         return NetworkOffering(apiclient.createNetworkOffering(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete network offering"""
+         cmd = deleteNetworkOffering.deleteNetworkOfferingCmd()
+         cmd.id = self.id
+         apiclient.deleteNetworkOffering(cmd)
+         return
+ 
+     def update(self, apiclient, **kwargs):
+         """Lists all available network offerings."""
+ 
+         cmd = updateNetworkOffering.updateNetworkOfferingCmd()
+         cmd.id = self.id
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.updateNetworkOffering(cmd))
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """Lists all available network offerings."""
+ 
+         cmd = listNetworkOfferings.listNetworkOfferingsCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listNetworkOfferings(cmd))
+ 
+ 
+ class SnapshotPolicy:
+     """Manage snapshot policies"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, volumeid, services):
+         """Create Snapshot policy"""
+         cmd = createSnapshotPolicy.createSnapshotPolicyCmd()
+         cmd.intervaltype = services["intervaltype"]
+         cmd.maxsnaps = services["maxsnaps"]
+         cmd.schedule = services["schedule"]
+         cmd.timezone = services["timezone"]
+         cmd.volumeid = volumeid
+         return SnapshotPolicy(apiclient.createSnapshotPolicy(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete Snapshot policy"""
+         cmd = deleteSnapshotPolicies.deleteSnapshotPoliciesCmd()
+         cmd.id = self.id
+         apiclient.deleteSnapshotPolicies(cmd)
+         return
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """Lists snapshot policies."""
+ 
+         cmd = listSnapshotPolicies.listSnapshotPoliciesCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listSnapshotPolicies(cmd))
+ 
+ 
+ class LoadBalancerRule:
+     """Manage Load Balancer rule"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services, ipaddressid=None, accountid=None,
+                             networkid=None, projectid=None, domainid=None):
+         """Create Load balancing Rule"""
+ 
+         cmd = createLoadBalancerRule.createLoadBalancerRuleCmd()
+ 
+         if ipaddressid:
+             cmd.publicipid = ipaddressid
+         elif "ipaddressid" in services:
+             cmd.publicipid = services["ipaddressid"]
+ 
+         if accountid:
+             cmd.account = accountid
+         elif "account" in services:
+             cmd.account = services["account"]
+ 
+         if domainid:
+             cmd.domainid = domainid
+ 
+         cmd.name = services["name"]
+         cmd.algorithm = services["alg"]
+         cmd.privateport = services["privateport"]
+         cmd.publicport = services["publicport"]
+ 
+         if "openfirewall" in services:
+             cmd.openfirewall = services["openfirewall"]
+ 
+         if projectid:
+             cmd.projectid = projectid
+ 
+         if networkid:
+             cmd.networkid = networkid
+         return LoadBalancerRule(apiclient.createLoadBalancerRule(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete load balancing rule"""
+         cmd = deleteLoadBalancerRule.deleteLoadBalancerRuleCmd()
+         cmd.id = self.id
+         apiclient.deleteLoadBalancerRule(cmd)
+         return
+ 
+     def assign(self, apiclient, vms):
+         """Assign virtual machines to load balancing rule"""
+         cmd = assignToLoadBalancerRule.assignToLoadBalancerRuleCmd()
+         cmd.id = self.id
+         cmd.virtualmachineids = [str(vm.id) for vm in vms]
+         apiclient.assignToLoadBalancerRule(cmd)
+         return
+ 
+     def remove(self, apiclient, vms):
+         """Remove virtual machines from load balancing rule"""
+         cmd = removeFromLoadBalancerRule.removeFromLoadBalancerRuleCmd()
+         cmd.id = self.id
+         cmd.virtualmachineids = [str(vm.id) for vm in vms]
+         apiclient.removeFromLoadBalancerRule(cmd)
+         return
+ 
+     def update(self, apiclient, algorithm=None, description=None, name=None, **kwargs):
+         """Updates the load balancing rule"""
+         cmd = updateLoadBalancerRule.updateLoadBalancerRuleCmd()
+         cmd.id = self.id
+         if algorithm:
+             cmd.algorithm = algorithm
+         if description:
+             cmd.description = description
+         if name:
+             cmd.name = name
+ 
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return apiclient.updateLoadBalancerRule(cmd)
+ 
+     def createSticky(self, apiclient, methodname, name, description=None, param=None):
+         """Creates a sticky policy for the LB rule"""
+ 
+         cmd = createLBStickinessPolicy.createLBStickinessPolicyCmd()
+         cmd.lbruleid = self.id
+         cmd.methodname = methodname
+         cmd.name = name
+         if description:
+             cmd.description = description
+         if param:
+             cmd.param = []
+             for name, value in param.items():
+                 cmd.param.append({'name': name, 'value': value})
+         return apiclient.createLBStickinessPolicy(cmd)
+ 
+     def deleteSticky(self, apiclient, id):
+         """Deletes stickyness policy"""
+ 
+         cmd = deleteLBStickinessPolicy.deleteLBStickinessPolicyCmd()
+         cmd.id = id
+         return apiclient.deleteLBStickinessPolicy(cmd)
+ 
+     @classmethod
+     def listStickyPolicies(cls, apiclient, lbruleid, **kwargs):
+         """Lists stickiness policies for load balancing rule"""
+ 
+         cmd= listLBStickinessPolicies.listLBStickinessPoliciesCmd()
+         cmd.lbruleid = lbruleid
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return apiclient.listLBStickinessPolicies(cmd)
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """List all Load balancing rules matching criteria"""
+ 
+         cmd = listLoadBalancerRules.listLoadBalancerRulesCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listLoadBalancerRules(cmd))
+ 
+ 
+ class Cluster:
+     """Manage Cluster life cycle"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services, zoneid=None, podid=None):
+         """Create Cluster"""
+         cmd = addCluster.addClusterCmd()
+         cmd.clustertype = services["clustertype"]
+         cmd.hypervisor = services["hypervisor"]
+ 
+         if zoneid:
+             cmd.zoneid = zoneid
+         else:
+             cmd.zoneid = services["zoneid"]
+ 
+         if podid:
+             cmd.podid = podid
+         else:
+             cmd.podid = services["podid"]
+ 
+         if "username" in services:
+             cmd.username = services["username"]
+         if "password" in services:
+             cmd.password = services["password"]
+         if "url" in services:
+             cmd.url = services["url"]
+         if "clustername" in services:
+             cmd.clustername = services["clustername"]
+ 
+         return Cluster(apiclient.addCluster(cmd)[0].__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete Cluster"""
+         cmd = deleteCluster.deleteClusterCmd()
+         cmd.id = self.id
+         apiclient.deleteCluster(cmd)
+         return
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """List all Clusters matching criteria"""
+ 
+         cmd = listClusters.listClustersCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listClusters(cmd))
+ 
+ 
+ class Host:
+     """Manage Host life cycle"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, cluster, services, zoneid=None, podid=None):
+         """Create Host in cluster"""
+ 
+         cmd = addHost.addHostCmd()
+         cmd.hypervisor = services["hypervisor"]
+         cmd.url = services["url"]
+         cmd.clusterid = cluster.id
+ 
+         if zoneid:
+             cmd.zoneid = zoneid
+         else:
+             cmd.zoneid = services["zoneid"]
+ 
+         if podid:
+             cmd.podid = podid
+         else:
+             cmd.podid = services["podid"]
+ 
+         if "clustertype" in services:
+             cmd.clustertype = services["clustertype"]
+         if "username" in services:
+             cmd.username = services["username"]
+         if "password" in services:
+             cmd.password = services["password"]
+ 
+         # Add host
+         host = apiclient.addHost(cmd)
+ 
+         if isinstance(host, list):
+             return Host(host[0].__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete Host"""
+         # Host must be in maintenance mode before deletion
+         cmd = prepareHostForMaintenance.prepareHostForMaintenanceCmd()
+         cmd.id = self.id
+         apiclient.prepareHostForMaintenance(cmd)
+         time.sleep(30)
+ 
+         cmd = deleteHost.deleteHostCmd()
+         cmd.id = self.id
+         apiclient.deleteHost(cmd)
+         return
+ 
+     def enableMaintenance(self, apiclient):
+         """enables maintainance mode Host"""
+ 
+         cmd = prepareHostForMaintenance.prepareHostForMaintenanceCmd()
+         cmd.id = self.id
+         return apiclient.prepareHostForMaintenance(cmd)
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """List all Hosts matching criteria"""
+ 
+         cmd = listHosts.listHostsCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listHosts(cmd))
+ 
+ 
+ class StoragePool:
+     """Manage Storage pools (Primary Storage)"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services, clusterid=None,
+                                         zoneid=None, podid=None):
+         """Create Storage pool (Primary Storage)"""
+ 
+         cmd = createStoragePool.createStoragePoolCmd()
+         cmd.name = services["name"]
+ 
+         if podid:
+             cmd.podid = podid
+         else:
+             cmd.podid = services["podid"]
+ 
+         cmd.url = services["url"]
+         if clusterid:
+             cmd.clusterid = clusterid
+         elif "clusterid" in services:
+             cmd.clusterid = services["clusterid"]
+ 
+         if zoneid:
+             cmd.zoneid = zoneid
+         else:
+             cmd.zoneid = services["zoneid"]
+ 
+         return StoragePool(apiclient.createStoragePool(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete Storage pool (Primary Storage)"""
+ 
+         # Storage pool must be in maintenance mode before deletion
+         cmd = enableStorageMaintenance.enableStorageMaintenanceCmd()
+         cmd.id = self.id
+         apiclient.enableStorageMaintenance(cmd)
+         time.sleep(30)
+         cmd = deleteStoragePool.deleteStoragePoolCmd()
+         cmd.id = self.id
+         apiclient.deleteStoragePool(cmd)
+         return
+ 
+     def enableMaintenance(self, apiclient):
+         """enables maintainance mode Storage pool"""
+ 
+         cmd = enableStorageMaintenance.enableStorageMaintenanceCmd()
+         cmd.id = self.id
+         return apiclient.enableStorageMaintenance(cmd)
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """List all storage pools matching criteria"""
+ 
+         cmd = listStoragePools.listStoragePoolsCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listStoragePools(cmd))
+ 
+ 
+ class Network:
+     """Manage Network pools"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services, accountid=None, domainid=None,
+                networkofferingid=None, projectid=None, zoneid=None,
+                gateway=None, netmask=None, vpcid=None, guestcidr=None):
+         """Create Network for account"""
+         cmd = createNetwork.createNetworkCmd()
+         cmd.name = services["name"]
+         cmd.displaytext = services["displaytext"]
+ 
+         if networkofferingid:
+             cmd.networkofferingid = networkofferingid
+         elif "networkoffering" in services:
+             cmd.networkofferingid = services["networkoffering"]
+ 
+         if zoneid:
+             cmd.zoneid = zoneid
+         elif "zoneid" in services:
+             cmd.zoneid = services["zoneid"]
+ 
+         if gateway:
+             cmd.gateway = gateway
+         elif "gateway" in services:
+             cmd.gateway = services["gateway"]
+         if netmask:
+             cmd.netmask = netmask
+         elif "netmask" in services:
+             cmd.netmask = services["netmask"]
+         if "startip" in services:
+             cmd.startip = services["startip"]
+         if "endip" in services:
+             cmd.endip = services["endip"]
+         if "vlan" in services:
+             cmd.vlan = services["vlan"]
+         if "acltype" in services:
+             cmd.acltype = services["acltype"]
+ 
+         if accountid:
+             cmd.account = accountid
+         if domainid:
+             cmd.domainid = domainid
+         if projectid:
+             cmd.projectid = projectid
+         if guestcidr:
+             cmd.guestcidr = guestcidr
+         if vpcid:
+             cmd.vpcid = vpcid
+         return Network(apiclient.createNetwork(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete Account"""
+ 
+         cmd = deleteNetwork.deleteNetworkCmd()
+         cmd.id = self.id
+         apiclient.deleteNetwork(cmd)
+ 
+     def update(self, apiclient, **kwargs):
+         """Updates network with parameters passed"""
+ 
+         cmd = updateNetwork.updateNetworkCmd()
+         cmd.id = self.id
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.updateNetwork(cmd))
+ 
+     def restart(self, apiclient, cleanup=None):
+         """Restarts the network"""
+ 
+         cmd = restartNetwork.restartNetworkCmd()
+         cmd.id = self.id
+         if cleanup:
+             cmd.cleanup = cleanup
+         return(apiclient.restartNetwork(cmd))
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """List all Networks matching criteria"""
+ 
+         cmd = listNetworks.listNetworksCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listNetworks(cmd))
+ 
+ 
+ class NetworkACL:
+     """Manage Network ACL lifecycle"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, networkid, services, traffictype=None):
+         """Create network ACL rules(Ingress/Egress)"""
+ 
+         cmd = createNetworkACL.createNetworkACLCmd()
+         cmd.networkid = networkid
+         if "protocol" in services:
+             cmd.protocol = services["protocol"]
+ 
+         if services["protocol"] == 'ICMP':
+             cmd.icmptype = -1
+             cmd.icmpcode = -1
+         else:
+             cmd.startport = services["startport"]
+             cmd.endport = services["endport"]
+ 
+         cmd.cidrlist = services["cidrlist"]
+         if traffictype:
+             cmd.traffictype = traffictype
+             # Defaulted to Ingress
+         return NetworkACL(apiclient.createNetworkACL(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete network acl"""
+ 
+         cmd = deleteNetworkACL.deleteNetworkACLCmd()
+         cmd.id = self.id
+         return apiclient.deleteNetworkACL(cmd)
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """List Network ACLs"""
+ 
+         cmd = listNetworkACLs.listNetworkACLsCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listNetworkACLs(cmd))
+ 
+ 
+ class Vpn:
+     """Manage VPN life cycle"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, publicipid, account=None, domainid=None,
+                                                             projectid=None, vpcid=None):
+         """Create VPN for Public IP address"""
+         cmd = createRemoteAccessVpn.createRemoteAccessVpnCmd()
+         cmd.publicipid = publicipid
+         if account:
+             cmd.account = account
+         if domainid:
+             cmd.domainid = domainid
+         if projectid:
+             cmd.projectid = projectid
+         if vpcid:
+             cmd.vpcid = vpcid
+         return Vpn(apiclient.createRemoteAccessVpn(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete remote VPN access"""
+ 
+         cmd = deleteRemoteAccessVpn.deleteRemoteAccessVpnCmd()
+         cmd.publicipid = self.publicipid
+         apiclient.deleteRemoteAccessVpn(cmd)
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """List all VPN matching criteria"""
+ 
+         cmd = listRemoteAccessVpns.listRemoteAccessVpnsCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listRemoteAccessVpns(cmd))
+ 
+ 
+ class VpnUser:
+     """Manage VPN user"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, username, password, account=None, domainid=None,
+                projectid=None):
+         """Create VPN user"""
+         cmd = addVpnUser.addVpnUserCmd()
+         cmd.username = username
+         cmd.password = password
+ 
+         if account:
+             cmd.account = account
+         if domainid:
+             cmd.domainid = domainid
+         if projectid:
+             cmd.projectid = projectid
+         return VpnUser(apiclient.addVpnUser(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Remove VPN user"""
+ 
+         cmd = removeVpnUser.removeVpnUserCmd()
+         cmd.username = self.username
+         cmd.account = self.account
+         cmd.domainid = self.domainid
+         apiclient.removeVpnUser(cmd)
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """List all VPN Users matching criteria"""
+ 
+         cmd = listVpnUsers.listVpnUsersCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listVpnUsers(cmd))
+ 
+ 
+ class Zone:
+     """Manage Zone"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services, domainid=None):
+         """Create zone"""
+         cmd = createZone.createZoneCmd()
+         cmd.dns1 = services["dns1"]
+         cmd.internaldns1 = services["internaldns1"]
+         cmd.name = services["name"]
+         cmd.networktype = services["networktype"]
+ 
+         if "dns2" in services:
+             cmd.dns2 = services["dns2"]
+         if "internaldns2" in services:
+             cmd.internaldns2 = services["internaldns2"]
+         if domainid:
+             cmd.domainid = domainid
+ 
+         return Zone(apiclient.createZone(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete Zone"""
+ 
+         cmd = deleteZone.deleteZoneCmd()
+         cmd.id = self.id
+         apiclient.deleteZone(cmd)
+ 
+     def update(self, apiclient, **kwargs):
+         """Update the zone"""
+ 
+         cmd = updateZone.updateZoneCmd()
+         cmd.id = self.id
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return apiclient.updateZone(cmd)
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """List all Zones matching criteria"""
+ 
+         cmd = listZones.listZonesCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listZones(cmd))
+ 
+ 
+ class Pod:
+     """Manage Pod"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services):
+         """Create Pod"""
+         cmd = createPod.createPodCmd()
+         cmd.gateway = services["gateway"]
+         cmd.netmask = services["netmask"]
+         cmd.name = services["name"]
+         cmd.startip = services["startip"]
+         cmd.endip = services["endip"]
+         cmd.zoneid = services["zoneid"]
+ 
+         return Pod(apiclient.createPod(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete Pod"""
+ 
+         cmd = deletePod.deletePodCmd()
+         cmd.id = self.id
+         apiclient.deletePod(cmd)
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         "Returns a default pod for specified zone"
+ 
+         cmd = listPods.listPodsCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return apiclient.listPods(cmd)
+ 
+ 
+ class PublicIpRange:
+     """Manage VlanIpRange"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services):
+         """Create VlanIpRange"""
+ 
+         cmd = createVlanIpRange.createVlanIpRangeCmd()
+         cmd.gateway = services["gateway"]
+         cmd.netmask = services["netmask"]
+         cmd.forvirtualnetwork = services["forvirtualnetwork"]
+         cmd.startip = services["startip"]
+         cmd.endip = services["endip"]
+         cmd.zoneid = services["zoneid"]
+         cmd.podid = services["podid"]
+         cmd.vlan = services["vlan"]
+ 
+         return PublicIpRange(apiclient.createVlanIpRange(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete VlanIpRange"""
+ 
+         cmd = deleteVlanIpRange.deleteVlanIpRangeCmd()
+         cmd.id = self.id
+         apiclient.deleteVlanIpRange(cmd)
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """Lists all VLAN IP ranges."""
+ 
+         cmd = listVlanIpRanges.listVlanIpRangesCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listVlanIpRanges(cmd))
+ 
+ 
+ class SecondaryStorage:
+     """Manage Secondary storage"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services):
+         """Create Secondary Storage"""
+         cmd = addSecondaryStorage.addSecondaryStorageCmd()
+ 
+         cmd.url = services["url"]
+         if "zoneid" in services:
+             cmd.zoneid = services["zoneid"]
+         return SecondaryStorage(apiclient.addSecondaryStorage(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete Secondary Storage"""
+ 
+         cmd = deleteHost.deleteHostCmd()
+         cmd.id = self.id
+         apiclient.deleteHost(cmd)
+ 
+ 
+ class PhysicalNetwork:
+     """Manage physical network storage"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services, zoneid, domainid=None):
+         """Create physical network"""
+         cmd = createPhysicalNetwork.createPhysicalNetworkCmd()
+ 
+         cmd.name = services["name"]
+         cmd.zoneid = zoneid
+         if domainid:
+             cmd.domainid = domainid
+         return PhysicalNetwork(apiclient.createPhysicalNetwork(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete Physical Network"""
+ 
+         cmd = deletePhysicalNetwork.deletePhysicalNetworkCmd()
+         cmd.id = self.id
+         apiclient.deletePhysicalNetwork(cmd)
+ 
+     def update(self, apiclient, **kwargs):
+         """Update Physical network state"""
+ 
+         cmd = updatePhysicalNetwork.updatePhysicalNetworkCmd()
+         cmd.id = self.id
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return apiclient.updatePhysicalNetwork(cmd)
+ 
+     def addTrafficType(self, apiclient, type):
+         """Add Traffic type to Physical network"""
+ 
+         cmd = addTrafficType.addTrafficTypeCmd()
+         cmd.physicalnetworkid = self.id
+         cmd.traffictype = type
+         return apiclient.addTrafficType(cmd)
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """Lists all physical networks"""
+ 
+         cmd = listPhysicalNetworks.listPhysicalNetworksCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listPhysicalNetworks(cmd))
+ 
+ class SecurityGroup:
+     """Manage Security Groups"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services, account=None, domainid=None,
+                description=None, projectid=None):
+         """Create security group"""
+         cmd = createSecurityGroup.createSecurityGroupCmd()
+ 
+         cmd.name = services["name"]
+         if account:
+             cmd.account = account
+         if domainid:
+             cmd.domainid = domainid
+         if description:
+             cmd.description = description
+         if projectid:
+             cmd.projectid = projectid
+ 
+         return SecurityGroup(apiclient.createSecurityGroup(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete Security Group"""
+ 
+         cmd = deleteSecurityGroup.deleteSecurityGroupCmd()
+         cmd.id = self.id
+         apiclient.deleteSecurityGroup(cmd)
+ 
+     def authorize(self, apiclient, services,
+                   account=None, domainid=None, projectid=None):
+         """Authorize Ingress Rule"""
+ 
+         cmd = authorizeSecurityGroupIngress.authorizeSecurityGroupIngressCmd()
+ 
+         if domainid:
+             cmd.domainid = domainid
+         if account:
+             cmd.account = account
+ 
+         if projectid:
+             cmd.projectid = projectid
+         cmd.securitygroupid = self.id
+         cmd.protocol = services["protocol"]
+ 
+         if services["protocol"] == 'ICMP':
+             cmd.icmptype = -1
+             cmd.icmpcode = -1
+         else:
+             cmd.startport = services["startport"]
+             cmd.endport = services["endport"]
+ 
+         cmd.cidrlist = services["cidrlist"]
+         return (apiclient.authorizeSecurityGroupIngress(cmd).__dict__)
+ 
+     def revoke(self, apiclient, id):
+         """Revoke ingress rule"""
+ 
+         cmd = revokeSecurityGroupIngress.revokeSecurityGroupIngressCmd()
+         cmd.id = id
+         return apiclient.revokeSecurityGroupIngress(cmd)
+ 
+     def authorizeEgress(self, apiclient, services, account=None, domainid=None,
+                         projectid=None, user_secgrp_list={}):
+         """Authorize Egress Rule"""
+ 
+         cmd = authorizeSecurityGroupEgress.authorizeSecurityGroupEgressCmd()
+ 
+         if domainid:
+             cmd.domainid = domainid
+         if account:
+             cmd.account = account
+ 
+         if projectid:
+             cmd.projectid = projectid
+         cmd.securitygroupid = self.id
+         cmd.protocol = services["protocol"]
+ 
+         if services["protocol"] == 'ICMP':
+             cmd.icmptype = -1
+             cmd.icmpcode = -1
+         else:
+             cmd.startport = services["startport"]
+             cmd.endport = services["endport"]
+ 
+         cmd.cidrlist = services["cidrlist"]
+ 
+         cmd.usersecuritygrouplist = []
+         for account, group in user_secgrp_list.items():
+             cmd.usersecuritygrouplist.append({
+                                             'account': account,
+                                             'group': group
+                                            })
+ 
+         return (apiclient.authorizeSecurityGroupEgress(cmd).__dict__)
+ 
+     def revokeEgress(self, apiclient, id):
+         """Revoke Egress rule"""
+ 
+         cmd = revokeSecurityGroupEgress.revokeSecurityGroupEgressCmd()
+         cmd.id = id
+         return apiclient.revokeSecurityGroupEgress(cmd)
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """Lists all security groups."""
+ 
+         cmd = listSecurityGroups.listSecurityGroupsCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listSecurityGroups(cmd))
+ 
+ 
+ class Project:
+     """Manage Project life cycle"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services, account=None, domainid=None):
+         """Create project"""
+ 
+         cmd = createProject.createProjectCmd()
+         cmd.displaytext = services["displaytext"]
+         cmd.name = "-".join([services["name"], random_gen()])
+         if account:
+             cmd.account = account
+         if domainid:
+             cmd.domainid = domainid
+ 
+         return Project(apiclient.createProject(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Delete Project"""
+ 
+         cmd = deleteProject.deleteProjectCmd()
+         cmd.id = self.id
+         apiclient.deleteProject(cmd)
+ 
+     def update(self, apiclient, **kwargs):
+         """Updates the project"""
+ 
+         cmd = updateProject.updateProjectCmd()
+         cmd.id = self.id
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return apiclient.updateProject(cmd)
+ 
+     def activate(self, apiclient):
+         """Activates the suspended project"""
+ 
+         cmd = activateProject.activateProjectCmd()
+         cmd.id = self.id
+         return apiclient.activateProject(cmd)
+ 
+     def suspend(self, apiclient):
+         """Suspend the active project"""
+ 
+         cmd = suspendProject.suspendProjectCmd()
+         cmd.id = self.id
+         return apiclient.suspendProject(cmd)
+ 
+     def addAccount(self, apiclient, account=None, email=None):
+         """Add account to project"""
+ 
+         cmd = addAccountToProject.addAccountToProjectCmd()
+         cmd.projectid = self.id
+         if account:
+             cmd.account = account
+         if email:
+             cmd.email = email
+         return apiclient.addAccountToProject(cmd)
+ 
+     def deleteAccount(self, apiclient, account):
+         """Delete account from project"""
+ 
+         cmd = deleteAccountFromProject.deleteAccountFromProjectCmd()
+         cmd.projectid = self.id
+         cmd.account = account
+         return apiclient.deleteAccountFromProject(cmd)
+ 
+     @classmethod
+     def listAccounts(cls, apiclient, **kwargs):
+         """Lists all accounts associated with projects."""
+ 
+         cmd = listProjectAccounts.listProjectAccountsCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listProjectAccounts(cmd))
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """Lists all projects."""
+ 
+         cmd = listProjects.listProjectsCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listProjects(cmd))
+ 
+ 
+ class ProjectInvitation:
+     """Manage project invitations"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def update(cls, apiclient, projectid, accept, account=None, token=None):
+         """Updates the project invitation for that account"""
+ 
+         cmd = updateProjectInvitation.updateProjectInvitationCmd()
+         cmd.projectid = projectid
+         cmd.accept = accept
+         if account:
+             cmd.account = account
+         if token:
+             cmd.token = token
+ 
+         return (apiclient.updateProjectInvitation(cmd).__dict__)
+ 
+     def delete(self, apiclient, id):
+         """Deletes the project invitation"""
+ 
+         cmd = deleteProjectInvitation.deleteProjectInvitationCmd()
+         cmd.id = id
+         return apiclient.deleteProjectInvitation(cmd)
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """Lists project invitations"""
+ 
+         cmd = listProjectInvitations.listProjectInvitationsCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listProjectInvitations(cmd))
+ 
+ 
+ class Configurations:
+     """Manage Configuration"""
+ 
+     @classmethod
+     def update(cls, apiclient, name, value=None):
+         """Updates the specified configuration"""
+ 
+         cmd = updateConfiguration.updateConfigurationCmd()
+         cmd.name = name
+         cmd.value = value
+         apiclient.updateConfiguration(cmd)
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """Lists configurations"""
+ 
+         cmd = listConfigurations.listConfigurationsCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listConfigurations(cmd))
+ 
+ 
+ class NetScaler:
+     """Manage external netscaler device"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def add(cls, apiclient, services, physicalnetworkid, username=None, password=None):
+         """Add external netscaler device to cloudstack"""
+ 
+         cmd = addNetscalerLoadBalancer.addNetscalerLoadBalancerCmd()
+         cmd.physicalnetworkid = physicalnetworkid
+         if username:
+             cmd.username = username
+         else:
+             cmd.username = services["username"]
+ 
+         if password:
+             cmd.password = password
+         else:
+             cmd.password = services["password"]
+ 
+         cmd.networkdevicetype = services["networkdevicetype"]
+ 
+         # Generate the URL
+         url = 'https://' + str(services["ipaddress"]) + '?'
+         url = url + 'publicinterface=' + str(services["publicinterface"]) + '&'
+         url = url + 'privateinterface=' + str(services["privateinterface"]) + '&'
+         url = url + 'numretries=' + str(services["numretries"]) + '&'
+ 
+         if not services["lbdevicededicated"] and "lbdevicecapacity" in services:
+             url = url + 'lbdevicecapacity=' + str(services["lbdevicecapacity"]) + '&'
+ 
+         url = url + 'lbdevicededicated=' + str(services["lbdevicededicated"])
+ 
+         cmd.url = url
+         return NetScaler(apiclient.addNetscalerLoadBalancer(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Deletes a netscaler device from CloudStack"""
+ 
+         cmd = deleteNetscalerLoadBalancer.deleteNetscalerLoadBalancerCmd()
+         cmd.lbdeviceid = self.lbdeviceid
+         apiclient.deleteNetscalerLoadBalancer(cmd)
+         return
+ 
+     def configure(self, apiclient, **kwargs):
+         """List already registered netscaler devices"""
+ 
+         cmd = configureNetscalerLoadBalancer.configureNetscalerLoadBalancerCmd()
+         cmd.lbdeviceid = self.lbdeviceid
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.configureNetscalerLoadBalancer(cmd))
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """List already registered netscaler devices"""
+ 
+         cmd = listNetscalerLoadBalancers.listNetscalerLoadBalancersCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listNetscalerLoadBalancers(cmd))
+ 
+ 
+ class NetworkServiceProvider:
+     """Manage network serivce providers for CloudStack"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def add(cls, apiclient, name, physicalnetworkid, servicelist):
+         """Adds network service provider"""
+ 
+         cmd = addNetworkServiceProvider.addNetworkServiceProviderCmd()
+         cmd.name = name
+         cmd.physicalnetworkid = physicalnetworkid
+         cmd.servicelist = servicelist
+         return NetworkServiceProvider(apiclient.addNetworkServiceProvider(cmd).__dict__)
+ 
+     def delete(self, apiclient):
+         """Deletes network service provider"""
+ 
+         cmd = deleteNetworkServiceProvider.deleteNetworkServiceProviderCmd()
+         cmd.id = self.id
+         return apiclient.deleteNetworkServiceProvider(cmd)
+ 
+     def update(self, apiclient, **kwargs):
+         """Updates network service provider"""
+ 
+         cmd = updateNetworkServiceProvider.updateNetworkServiceProviderCmd()
+         cmd.id = self.id
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return apiclient.updateNetworkServiceProvider(cmd)
+ 
+     @classmethod
+     def update(cls, apiclient, id, **kwargs):
+         """Updates network service provider"""
+ 
+         cmd = updateNetworkServiceProvider.updateNetworkServiceProviderCmd()
+         cmd.id = id
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return apiclient.updateNetworkServiceProvider(cmd)
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """List network service providers"""
+ 
+         cmd = listNetworkServiceProviders.listNetworkServiceProvidersCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listNetworkServiceProviders(cmd))
+ 
+ class VpcOffering:
+     """Manage VPC offerings"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services):
+         """Create vpc offering"""
+ 
+         cmd = createVPCOffering.createVPCOfferingCmd()
+         cmd.name = "-".join([services["name"], random_gen()])
+         cmd.displaytext = services["displaytext"]
+         cmd.supportedServices = services["supportedservices"]
+         return VpcOffering(apiclient.createVPCOffering(cmd).__dict__)
+ 
+     def update(self, apiclient, name=None, displaytext=None, state=None):
+         """Updates existing VPC offering"""
+ 
+         cmd = updateVPCOffering.updateVPCOfferingCmd()
+         cmd.id = self.id
+         if name:
+             cmd.name = name
+         if displaytext:
+             cmd.displaytext = displaytext
+         if state:
+             cmd.state = state
+         return apiclient.updateVPCOffering(cmd)
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """List the VPC offerings based on criteria specified"""
+ 
+         cmd = listVPCOfferings.listVPCOfferingsCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listVPCOfferings(cmd))
+ 
+     def delete(self, apiclient):
+         """Deletes existing VPC offering"""
+ 
+         cmd = deleteVPCOffering.deleteVPCOfferingCmd()
+         cmd.id = self.id
+         return apiclient.deleteVPCOffering(cmd)
+ 
+ 
+ class VPC:
+     """Manage Virtual Private Connection"""
+ 
+     def __init__(self, items):
+         self.__dict__.update(items)
+ 
+     @classmethod
+     def create(cls, apiclient, services, vpcofferingid,
+                zoneid, networkDomain=None, account=None, domainid=None):
+         """Creates the virtual private connection (VPC)"""
+ 
+         cmd = createVPC.createVPCCmd()
+         cmd.name = "-".join([services["name"], random_gen()])
+         cmd.displaytext = "-".join([services["displaytext"], random_gen()])
+         cmd.vpcofferingid = vpcofferingid
+         cmd.zoneid = zoneid
+         cmd.cidr = services["cidr"]
+         if account:
+             cmd.account = account
+         if domainid:
+             cmd.domainid = domainid
+         if networkDomain:
+             cmd.networkDomain = networkDomain
+         return VPC(apiclient.createVPC(cmd).__dict__)
+ 
+     def update(self, apiclient, name=None, displaytext=None):
+         """Updates VPC configurations"""
+ 
+         cmd = updateVPC.updateVPCCmd()
+         cmd.id = self.id
+         if name:
+             cmd.name = name
+         if displaytext:
+             cmd.displaytext = displaytext
+         return (apiclient.updateVPC(cmd))
+ 
+     def delete(self, apiclient):
+         """Delete VPC network"""
+ 
+         cmd = deleteVPC.deleteVPCCmd()
+         cmd.id = self.id
+         return apiclient.deleteVPC(cmd)
+ 
+     def restart(self, apiclient):
+         """Restarts the VPC connections"""
+ 
+         cmd = restartVPC.restartVPCCmd()
+         cmd.id = self.id
+         return apiclient.restartVPC(cmd)
+ 
+     @classmethod
+     def list(cls, apiclient, **kwargs):
+         """List VPCs"""
+ 
+         cmd = listVPCs.listVPCsCmd()
+         [setattr(cmd, k, v) for k, v in kwargs.items()]
+         return(apiclient.listVPCs(cmd))

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2a990642/ui/scripts/zoneWizard.js
----------------------------------------------------------------------
diff --cc ui/scripts/zoneWizard.js
index 8add9bb,51c956d..4752a4d
--- a/ui/scripts/zoneWizard.js
+++ b/ui/scripts/zoneWizard.js
@@@ -1200,11 -1196,11 +1200,11 @@@
                  return;
                }
  
-                 // ZWPS is supported only for KVM as the hypervisor
-              if(selectedHypervisorObj.hypervisortype != "KVM"){
+                 // ZWPS not supported for Xenserver
+              if(selectedHypervisorObj.hypervisortype == "XenServer"){
                         var scope=[];
                         scope.push({ id: 'cluster', description: _l('label.cluster') });
 -                       scope.push({ id: 'host', description: _l('label.host') });
 +                       //scope.push({ id: 'host', description: _l('label.host') });
                         args.response.success({data: scope});
                      }
  


[28/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
CLOUDSTACK-1825: Update AWSAPI server's XML configuration


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

Branch: refs/heads/marvin_refactor
Commit: 8165465cf1c84946033f9f05ac45190524052f05
Parents: 094ffed
Author: Kelven Yang <ke...@gmail.com>
Authored: Wed Mar 27 14:51:58 2013 -0700
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:18:40 2013 +0530

----------------------------------------------------------------------
 awsapi/conf/applicationContext.xml.in |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8165465c/awsapi/conf/applicationContext.xml.in
----------------------------------------------------------------------
diff --git a/awsapi/conf/applicationContext.xml.in b/awsapi/conf/applicationContext.xml.in
index 8b3a022..492f85b 100644
--- a/awsapi/conf/applicationContext.xml.in
+++ b/awsapi/conf/applicationContext.xml.in
@@ -43,7 +43,7 @@
   -->
   <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
   <bean id="transactionContextBuilder" class="com.cloud.utils.db.TransactionContextBuilder" />
- 
+
   <bean id="instantiatePostProcessor" class="com.cloud.utils.component.ComponentInstantiationPostProcessor">
     <property name="Interceptors">
         <list>
@@ -51,5 +51,5 @@
         </list>
     </property>
   </bean>
- 
+
 </beans>


[05/50] [abbrv] base dict object updated as **kwargs from factory

Posted by ts...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/ServiceForVirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ServiceForVirtualMachine.py b/tools/marvin/marvin/integration/lib/base/ServiceForVirtualMachine.py
index b74134d..9c75a5e 100644
--- a/tools/marvin/marvin/integration/lib/base/ServiceForVirtualMachine.py
+++ b/tools/marvin/marvin/integration/lib/base/ServiceForVirtualMachine.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import changeServiceForVirtualMachine
 
-class ServiceForVirtualMachine(CloudStackEntity):
+class ServiceForVirtualMachine(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def change(self, apiclient, id, serviceofferingid, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/ServiceOffering.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ServiceOffering.py b/tools/marvin/marvin/integration/lib/base/ServiceOffering.py
index 8e8174c..cdc6737 100644
--- a/tools/marvin/marvin/integration/lib/base/ServiceOffering.py
+++ b/tools/marvin/marvin/integration/lib/base/ServiceOffering.py
@@ -20,11 +20,11 @@ from marvin.cloudstackAPI import listServiceOfferings
 from marvin.cloudstackAPI import updateServiceOffering
 from marvin.cloudstackAPI import deleteServiceOffering
 
-class ServiceOffering(CloudStackEntity):
+class ServiceOffering(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Simulator.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Simulator.py b/tools/marvin/marvin/integration/lib/base/Simulator.py
index 5c58dde..31a2dc7 100644
--- a/tools/marvin/marvin/integration/lib/base/Simulator.py
+++ b/tools/marvin/marvin/integration/lib/base/Simulator.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import configureSimulator
 
-class Simulator(CloudStackEntity):
+class Simulator(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def configure(self, apiclient, name, value, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Snapshot.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Snapshot.py b/tools/marvin/marvin/integration/lib/base/Snapshot.py
index 989e7fb..8282a9b 100644
--- a/tools/marvin/marvin/integration/lib/base/Snapshot.py
+++ b/tools/marvin/marvin/integration/lib/base/Snapshot.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import createSnapshot
 from marvin.cloudstackAPI import listSnapshots
 from marvin.cloudstackAPI import deleteSnapshot
 
-class Snapshot(CloudStackEntity):
+class Snapshot(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/SnapshotPolicies.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SnapshotPolicies.py b/tools/marvin/marvin/integration/lib/base/SnapshotPolicies.py
index 1a9c906..09284d5 100644
--- a/tools/marvin/marvin/integration/lib/base/SnapshotPolicies.py
+++ b/tools/marvin/marvin/integration/lib/base/SnapshotPolicies.py
@@ -18,11 +18,11 @@ from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listSnapshotPolicies
 from marvin.cloudstackAPI import deleteSnapshotPolicies
 
-class SnapshotPolicies(CloudStackEntity):
+class SnapshotPolicies(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/SnapshotPolicy.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SnapshotPolicy.py b/tools/marvin/marvin/integration/lib/base/SnapshotPolicy.py
index 18394b1..bf6f210 100644
--- a/tools/marvin/marvin/integration/lib/base/SnapshotPolicy.py
+++ b/tools/marvin/marvin/integration/lib/base/SnapshotPolicy.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import createSnapshotPolicy
 
-class SnapshotPolicy(CloudStackEntity):
+class SnapshotPolicy(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/StaticNat.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/StaticNat.py b/tools/marvin/marvin/integration/lib/base/StaticNat.py
index 103fb51..3284666 100644
--- a/tools/marvin/marvin/integration/lib/base/StaticNat.py
+++ b/tools/marvin/marvin/integration/lib/base/StaticNat.py
@@ -18,11 +18,11 @@ from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import enableStaticNat
 from marvin.cloudstackAPI import disableStaticNat
 
-class StaticNat(CloudStackEntity):
+class StaticNat(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def enable(self, apiclient, ipaddressid, virtualmachineid, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/StaticRoute.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/StaticRoute.py b/tools/marvin/marvin/integration/lib/base/StaticRoute.py
index f96a4dc..da3d297 100644
--- a/tools/marvin/marvin/integration/lib/base/StaticRoute.py
+++ b/tools/marvin/marvin/integration/lib/base/StaticRoute.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import createStaticRoute
 from marvin.cloudstackAPI import listStaticRoutes
 from marvin.cloudstackAPI import deleteStaticRoute
 
-class StaticRoute(CloudStackEntity):
+class StaticRoute(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/StorageMaintenance.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/StorageMaintenance.py b/tools/marvin/marvin/integration/lib/base/StorageMaintenance.py
index 10a8be7..eb3591d 100644
--- a/tools/marvin/marvin/integration/lib/base/StorageMaintenance.py
+++ b/tools/marvin/marvin/integration/lib/base/StorageMaintenance.py
@@ -18,11 +18,11 @@ from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import cancelStorageMaintenance
 from marvin.cloudstackAPI import enableStorageMaintenance
 
-class StorageMaintenance(CloudStackEntity):
+class StorageMaintenance(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def cancel(self, apiclient, id, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/StorageNetworkIpRange.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/StorageNetworkIpRange.py b/tools/marvin/marvin/integration/lib/base/StorageNetworkIpRange.py
index 2bc6b5b..ad119d0 100644
--- a/tools/marvin/marvin/integration/lib/base/StorageNetworkIpRange.py
+++ b/tools/marvin/marvin/integration/lib/base/StorageNetworkIpRange.py
@@ -20,11 +20,11 @@ from marvin.cloudstackAPI import listStorageNetworkIpRange
 from marvin.cloudstackAPI import updateStorageNetworkIpRange
 from marvin.cloudstackAPI import deleteStorageNetworkIpRange
 
-class StorageNetworkIpRange(CloudStackEntity):
+class StorageNetworkIpRange(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/StoragePool.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/StoragePool.py b/tools/marvin/marvin/integration/lib/base/StoragePool.py
index d15de83..ecef9b7 100644
--- a/tools/marvin/marvin/integration/lib/base/StoragePool.py
+++ b/tools/marvin/marvin/integration/lib/base/StoragePool.py
@@ -20,11 +20,11 @@ from marvin.cloudstackAPI import listStoragePools
 from marvin.cloudstackAPI import updateStoragePool
 from marvin.cloudstackAPI import deleteStoragePool
 
-class StoragePool(CloudStackEntity):
+class StoragePool(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/SupportedNetworkServices.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SupportedNetworkServices.py b/tools/marvin/marvin/integration/lib/base/SupportedNetworkServices.py
index 93784b5..c04976a 100644
--- a/tools/marvin/marvin/integration/lib/base/SupportedNetworkServices.py
+++ b/tools/marvin/marvin/integration/lib/base/SupportedNetworkServices.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listSupportedNetworkServices
 
-class SupportedNetworkServices(CloudStackEntity):
+class SupportedNetworkServices(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Swift.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Swift.py b/tools/marvin/marvin/integration/lib/base/Swift.py
index 6f74460..0630862 100644
--- a/tools/marvin/marvin/integration/lib/base/Swift.py
+++ b/tools/marvin/marvin/integration/lib/base/Swift.py
@@ -18,11 +18,11 @@ from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import addSwift
 from marvin.cloudstackAPI import listSwifts
 
-class Swift(CloudStackEntity):
+class Swift(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def add(self, apiclient, url, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/SystemVm.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SystemVm.py b/tools/marvin/marvin/integration/lib/base/SystemVm.py
index 6fabe6f..7639416 100644
--- a/tools/marvin/marvin/integration/lib/base/SystemVm.py
+++ b/tools/marvin/marvin/integration/lib/base/SystemVm.py
@@ -22,11 +22,11 @@ from marvin.cloudstackAPI import rebootSystemVm
 from marvin.cloudstackAPI import startSystemVm
 from marvin.cloudstackAPI import destroySystemVm
 
-class SystemVm(CloudStackEntity):
+class SystemVm(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def migrate(self, apiclient, hostid, virtualmachineid, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Tags.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Tags.py b/tools/marvin/marvin/integration/lib/base/Tags.py
index e46742b..e51043b 100644
--- a/tools/marvin/marvin/integration/lib/base/Tags.py
+++ b/tools/marvin/marvin/integration/lib/base/Tags.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import createTags
 from marvin.cloudstackAPI import listTags
 from marvin.cloudstackAPI import deleteTags
 
-class Tags(CloudStackEntity):
+class Tags(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Template.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Template.py b/tools/marvin/marvin/integration/lib/base/Template.py
index 1f62158..85ef6a7 100644
--- a/tools/marvin/marvin/integration/lib/base/Template.py
+++ b/tools/marvin/marvin/integration/lib/base/Template.py
@@ -24,11 +24,11 @@ from marvin.cloudstackAPI import copyTemplate
 from marvin.cloudstackAPI import extractTemplate
 from marvin.cloudstackAPI import deleteTemplate
 
-class Template(CloudStackEntity):
+class Template(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def prepare(self, apiclient, zoneid, templateid, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/TemplatePermissions.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/TemplatePermissions.py b/tools/marvin/marvin/integration/lib/base/TemplatePermissions.py
index e7b8edf..a6a240a 100644
--- a/tools/marvin/marvin/integration/lib/base/TemplatePermissions.py
+++ b/tools/marvin/marvin/integration/lib/base/TemplatePermissions.py
@@ -18,11 +18,11 @@ from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listTemplatePermissions
 from marvin.cloudstackAPI import updateTemplatePermissions
 
-class TemplatePermissions(CloudStackEntity):
+class TemplatePermissions(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py b/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py
index f440466..52bb579 100644
--- a/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py
+++ b/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import assignToLoadBalancerRule
 
-class ToLoadBalancerRule(CloudStackEntity):
+class ToLoadBalancerRule(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def assign(self, apiclient, id, virtualmachineids, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/TrafficMonitor.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/TrafficMonitor.py b/tools/marvin/marvin/integration/lib/base/TrafficMonitor.py
index d1f771a..164fec4 100644
--- a/tools/marvin/marvin/integration/lib/base/TrafficMonitor.py
+++ b/tools/marvin/marvin/integration/lib/base/TrafficMonitor.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import addTrafficMonitor
 from marvin.cloudstackAPI import listTrafficMonitors
 from marvin.cloudstackAPI import deleteTrafficMonitor
 
-class TrafficMonitor(CloudStackEntity):
+class TrafficMonitor(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def add(self, apiclient, url, zoneid, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/TrafficType.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/TrafficType.py b/tools/marvin/marvin/integration/lib/base/TrafficType.py
index 16aa0ba..7fe101a 100644
--- a/tools/marvin/marvin/integration/lib/base/TrafficType.py
+++ b/tools/marvin/marvin/integration/lib/base/TrafficType.py
@@ -20,11 +20,11 @@ from marvin.cloudstackAPI import listTrafficTypes
 from marvin.cloudstackAPI import updateTrafficType
 from marvin.cloudstackAPI import deleteTrafficType
 
-class TrafficType(CloudStackEntity):
+class TrafficType(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def add(self, apiclient, traffictype, physicalnetworkid, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/TrafficTypeImplementors.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/TrafficTypeImplementors.py b/tools/marvin/marvin/integration/lib/base/TrafficTypeImplementors.py
index 3aa9c76..d5e23ad 100644
--- a/tools/marvin/marvin/integration/lib/base/TrafficTypeImplementors.py
+++ b/tools/marvin/marvin/integration/lib/base/TrafficTypeImplementors.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listTrafficTypeImplementors
 
-class TrafficTypeImplementors(CloudStackEntity):
+class TrafficTypeImplementors(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/UsageRecords.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/UsageRecords.py b/tools/marvin/marvin/integration/lib/base/UsageRecords.py
index 1fd1e1c..1bd1765 100644
--- a/tools/marvin/marvin/integration/lib/base/UsageRecords.py
+++ b/tools/marvin/marvin/integration/lib/base/UsageRecords.py
@@ -18,11 +18,11 @@ from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listUsageRecords
 from marvin.cloudstackAPI import generateUsageRecords
 
-class UsageRecords(CloudStackEntity):
+class UsageRecords(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/UsageTypes.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/UsageTypes.py b/tools/marvin/marvin/integration/lib/base/UsageTypes.py
index e0118b7..0c73f3b 100644
--- a/tools/marvin/marvin/integration/lib/base/UsageTypes.py
+++ b/tools/marvin/marvin/integration/lib/base/UsageTypes.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listUsageTypes
 
-class UsageTypes(CloudStackEntity):
+class UsageTypes(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/User.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/User.py b/tools/marvin/marvin/integration/lib/base/User.py
index 37097bf..25ac70d 100644
--- a/tools/marvin/marvin/integration/lib/base/User.py
+++ b/tools/marvin/marvin/integration/lib/base/User.py
@@ -24,11 +24,11 @@ from marvin.cloudstackAPI import updateUser
 from marvin.cloudstackAPI import disableUser
 from marvin.cloudstackAPI import deleteUser
 
-class User(CloudStackEntity):
+class User(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def enable(self, apiclient, id, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/UserKeys.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/UserKeys.py b/tools/marvin/marvin/integration/lib/base/UserKeys.py
index 254aec8..09116e8 100644
--- a/tools/marvin/marvin/integration/lib/base/UserKeys.py
+++ b/tools/marvin/marvin/integration/lib/base/UserKeys.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import registerUserKeys
 
-class UserKeys(CloudStackEntity):
+class UserKeys(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def register(self, apiclient, id, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/VMPassword.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VMPassword.py b/tools/marvin/marvin/integration/lib/base/VMPassword.py
index da83d4c..5a6f797 100644
--- a/tools/marvin/marvin/integration/lib/base/VMPassword.py
+++ b/tools/marvin/marvin/integration/lib/base/VMPassword.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import getVMPassword
 
-class VMPassword(CloudStackEntity):
+class VMPassword(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def get(self, apiclient, id, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/VMSnapshot.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VMSnapshot.py b/tools/marvin/marvin/integration/lib/base/VMSnapshot.py
index 66a1707..cf179bf 100644
--- a/tools/marvin/marvin/integration/lib/base/VMSnapshot.py
+++ b/tools/marvin/marvin/integration/lib/base/VMSnapshot.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import createVMSnapshot
 from marvin.cloudstackAPI import listVMSnapshot
 from marvin.cloudstackAPI import deleteVMSnapshot
 
-class VMSnapshot(CloudStackEntity):
+class VMSnapshot(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/VPC.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VPC.py b/tools/marvin/marvin/integration/lib/base/VPC.py
index 6e48ce3..4e31fbe 100644
--- a/tools/marvin/marvin/integration/lib/base/VPC.py
+++ b/tools/marvin/marvin/integration/lib/base/VPC.py
@@ -21,11 +21,11 @@ from marvin.cloudstackAPI import updateVPC
 from marvin.cloudstackAPI import restartVPC
 from marvin.cloudstackAPI import deleteVPC
 
-class VPC(CloudStackEntity):
+class VPC(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/VPCOffering.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VPCOffering.py b/tools/marvin/marvin/integration/lib/base/VPCOffering.py
index c6d2bab..3afa7fd 100644
--- a/tools/marvin/marvin/integration/lib/base/VPCOffering.py
+++ b/tools/marvin/marvin/integration/lib/base/VPCOffering.py
@@ -20,11 +20,11 @@ from marvin.cloudstackAPI import listVPCOfferings
 from marvin.cloudstackAPI import updateVPCOffering
 from marvin.cloudstackAPI import deleteVPCOffering
 
-class VPCOffering(CloudStackEntity):
+class VPCOffering(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/VirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VirtualMachine.py b/tools/marvin/marvin/integration/lib/base/VirtualMachine.py
index c788f0c..c4bf052 100644
--- a/tools/marvin/marvin/integration/lib/base/VirtualMachine.py
+++ b/tools/marvin/marvin/integration/lib/base/VirtualMachine.py
@@ -26,11 +26,11 @@ from marvin.cloudstackAPI import startVirtualMachine
 from marvin.cloudstackAPI import destroyVirtualMachine
 from marvin.cloudstackAPI import assignVirtualMachine
 
-class VirtualMachine(CloudStackEntity):
+class VirtualMachine(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def restore(self, apiclient, virtualmachineid, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/VirtualRouterElement.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VirtualRouterElement.py b/tools/marvin/marvin/integration/lib/base/VirtualRouterElement.py
index 246162c..b811e7d 100644
--- a/tools/marvin/marvin/integration/lib/base/VirtualRouterElement.py
+++ b/tools/marvin/marvin/integration/lib/base/VirtualRouterElement.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import createVirtualRouterElement
 from marvin.cloudstackAPI import listVirtualRouterElements
 from marvin.cloudstackAPI import configureVirtualRouterElement
 
-class VirtualRouterElement(CloudStackEntity):
+class VirtualRouterElement(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/VlanIpRange.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VlanIpRange.py b/tools/marvin/marvin/integration/lib/base/VlanIpRange.py
index db1e4f0..ed79f5d 100644
--- a/tools/marvin/marvin/integration/lib/base/VlanIpRange.py
+++ b/tools/marvin/marvin/integration/lib/base/VlanIpRange.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import createVlanIpRange
 from marvin.cloudstackAPI import listVlanIpRanges
 from marvin.cloudstackAPI import deleteVlanIpRange
 
-class VlanIpRange(CloudStackEntity):
+class VlanIpRange(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Volume.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Volume.py b/tools/marvin/marvin/integration/lib/base/Volume.py
index 8c421c9..0bd3b3d 100644
--- a/tools/marvin/marvin/integration/lib/base/Volume.py
+++ b/tools/marvin/marvin/integration/lib/base/Volume.py
@@ -24,11 +24,11 @@ from marvin.cloudstackAPI import detachVolume
 from marvin.cloudstackAPI import extractVolume
 from marvin.cloudstackAPI import deleteVolume
 
-class Volume(CloudStackEntity):
+class Volume(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def migrate(self, apiclient, storageid, volumeid, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/VpnConnection.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VpnConnection.py b/tools/marvin/marvin/integration/lib/base/VpnConnection.py
index d76e5de..fbb96f3 100644
--- a/tools/marvin/marvin/integration/lib/base/VpnConnection.py
+++ b/tools/marvin/marvin/integration/lib/base/VpnConnection.py
@@ -20,11 +20,11 @@ from marvin.cloudstackAPI import createVpnConnection
 from marvin.cloudstackAPI import listVpnConnections
 from marvin.cloudstackAPI import deleteVpnConnection
 
-class VpnConnection(CloudStackEntity):
+class VpnConnection(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def reset(self, apiclient, id, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/VpnCustomerGateway.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VpnCustomerGateway.py b/tools/marvin/marvin/integration/lib/base/VpnCustomerGateway.py
index c57054b..61c6749 100644
--- a/tools/marvin/marvin/integration/lib/base/VpnCustomerGateway.py
+++ b/tools/marvin/marvin/integration/lib/base/VpnCustomerGateway.py
@@ -20,11 +20,11 @@ from marvin.cloudstackAPI import listVpnCustomerGateways
 from marvin.cloudstackAPI import updateVpnCustomerGateway
 from marvin.cloudstackAPI import deleteVpnCustomerGateway
 
-class VpnCustomerGateway(CloudStackEntity):
+class VpnCustomerGateway(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/VpnGateway.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VpnGateway.py b/tools/marvin/marvin/integration/lib/base/VpnGateway.py
index f39e7a7..ef9a8e7 100644
--- a/tools/marvin/marvin/integration/lib/base/VpnGateway.py
+++ b/tools/marvin/marvin/integration/lib/base/VpnGateway.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import createVpnGateway
 from marvin.cloudstackAPI import listVpnGateways
 from marvin.cloudstackAPI import deleteVpnGateway
 
-class VpnGateway(CloudStackEntity):
+class VpnGateway(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/VpnUser.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VpnUser.py b/tools/marvin/marvin/integration/lib/base/VpnUser.py
index 915396c..387352f 100644
--- a/tools/marvin/marvin/integration/lib/base/VpnUser.py
+++ b/tools/marvin/marvin/integration/lib/base/VpnUser.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import addVpnUser
 from marvin.cloudstackAPI import listVpnUsers
 from marvin.cloudstackAPI import removeVpnUser
 
-class VpnUser(CloudStackEntity):
+class VpnUser(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def add(self, apiclient, username, password, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Zone.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Zone.py b/tools/marvin/marvin/integration/lib/base/Zone.py
index feac7c6..d895e64 100644
--- a/tools/marvin/marvin/integration/lib/base/Zone.py
+++ b/tools/marvin/marvin/integration/lib/base/Zone.py
@@ -20,11 +20,11 @@ from marvin.cloudstackAPI import listZones
 from marvin.cloudstackAPI import updateZone
 from marvin.cloudstackAPI import deleteZone
 
-class Zone(CloudStackEntity):
+class Zone(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/test/testFactories.py b/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
index eec44de..b5a20dd 100644
--- a/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
+++ b/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
@@ -25,7 +25,17 @@ class AccountFactoryTest(unittest.TestCase):
         self.apiClient = cloudstackTestClient(mgtSvr='localhost')
 
     def test_userAccountFactory(self):
-        af = AccountFactory.AdminAccountFactory()
+        af = AccountFactory.AccountFactory()
+        accnt = Account.Account.create(apiclient=self.apiClient, AccountFactory=af)
+        self.assertTrue(accnt is not None, msg="no account created by factory")
+
+    def test_adminAccountFactory(self):
+        af = AccountFactory.AccountFactory()
+        accnt = Account.Account.create(apiclient=self.apiClient, AccountFactory=af)
+        self.assertTrue(accnt is not None, msg="no account created by factory")
+
+    def test_userAccountFactoryCustomArgs(self):
+        af = AccountFactory.AccountFactory(firstname='test', lastname='test')
         accnt = Account.Account.create(apiclient=self.apiClient, AccountFactory=af)
         self.assertTrue(accnt is not None, msg="no account created by factory")
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/generateBase.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/generateBase.py b/tools/marvin/marvin/integration/lib/generateBase.py
index f94043e..9eeba07 100644
--- a/tools/marvin/marvin/integration/lib/generateBase.py
+++ b/tools/marvin/marvin/integration/lib/generateBase.py
@@ -114,10 +114,10 @@ def write_entity_classes(entities):
         body = []
         imports = []
         imports.append('from marvin.integration.lib.base import CloudStackEntity')
-        body.append('class %s(CloudStackEntity):'%entity)
+        body.append('class %s(CloudStackEntity.CloudStackEntity):'%entity)
         body.append('\n')
-        body.append(tabspace + 'def __init__(self, items):')
-        body.append(tabspace*2 + 'self.__dict__.update(items)')
+        body.append(tabspace + 'def __init__(self, **kwargs):')
+        body.append(tabspace*2 + 'self.__dict__.update(**kwargs)')
         body.append('\n')
         for action, details in actions.iteritems():
             imports.append('from marvin.cloudstackAPI import %s'%details['apimodule'])


[37/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
new pom for dbcreator classes

reuse the setup as a cloudstack-setup-db project


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

Branch: refs/heads/marvin_refactor
Commit: 45af2ef4f6b9f5be63f0e89aa66d2b61a0455e70
Parents: 89ac2ab
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Tue Mar 5 11:48:16 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:19:15 2013 +0530

----------------------------------------------------------------------
 pom.xml |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/45af2ef4/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 5e5f624..9e9db69 100644
--- a/pom.xml
+++ b/pom.xml
@@ -170,6 +170,7 @@
     <module>services</module>
     <module>test</module>
     <module>client</module>
+    <module>setup</module>
   </modules>
 
   <dependencyManagement>


[21/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
CLOUDSTACK-452: cloudstack UI - zone wizard - when Basic mode is selected, hide IPv6 DNS1, IPv6 DNS2 field.


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

Branch: refs/heads/marvin_refactor
Commit: 3e88a43d0feae46e05e685238c6ef0454be529d5
Parents: 48cd9cc
Author: Jessica Wang <je...@citrix.com>
Authored: Tue Mar 26 16:48:50 2013 -0700
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:05:41 2013 +0530

----------------------------------------------------------------------
 ui/scripts/zoneWizard.js |   38 +++++++++++---------------------------
 1 files changed, 11 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3e88a43d/ui/scripts/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js
index a64c86a..53f1684 100755
--- a/ui/scripts/zoneWizard.js
+++ b/ui/scripts/zoneWizard.js
@@ -322,7 +322,7 @@
 
           if (args.data['network-model'] == 'Basic') {
             args.$form.find('[rel=networkOfferingId]').show();
-            args.$form.find('[rel=guestcidraddress]').hide();						
+            args.$form.find('[rel=guestcidraddress]').hide();
 						args.$form.find('[rel=ip6dns1]').hide();
 						args.$form.find('[rel=ip6dns2]').hide();
           }
@@ -333,10 +333,10 @@
               args.$form.find('[rel=guestcidraddress]').show();
 						else //args.data["zone-advanced-sg-enabled"] ==	"on
 						  args.$form.find('[rel=guestcidraddress]').hide();
-          					  
+
 						args.$form.find('[rel=ip6dns1]').show();
 						args.$form.find('[rel=ip6dns2]').show();
-					}													
+					}
 										
           setTimeout(function() {
             if ($form.find('input[name=ispublic]').is(':checked')) {
@@ -1185,32 +1185,16 @@
            scope: {
                     label: 'label.scope',
                     select: function(args) {
-                    
-             var selectedHypervisorObj = {
-                hypervisortype: $.isArray(args.context.zones[0].hypervisor) ?
-                  // We want the cluster's hypervisor type
-                  args.context.zones[0].hypervisor[1] : args.context.zones[0].hypervisor
-              };
 
-              if(selectedHypervisorObj == null) {
-                return;
-              }
-
-                // ZWPS is supported only for KVM as the hypervisor
-             if(selectedHypervisorObj.hypervisortype != "KVM"){
-                       var scope=[];
-                       scope.push({ id: 'cluster', description: _l('label.cluster') });
-                       scope.push({ id: 'host', description: _l('label.host') });
-                       args.response.success({data: scope});
-                    }
+            var scope = [
+                        { id: 'zone', description: _l('label.zone.wide') },
+                        { id: 'cluster', description: _l('label.cluster') },
+                        { id: 'host', description: _l('label.host') }
+                      ];
 
-              else {
-                       var scope=[];
-                       scope.push({ id: 'zone', description: _l('label.zone.wide') });
-                       scope.push({ id: 'cluster', description: _l('label.cluster') });
-                       scope.push({ id: 'host', description: _l('label.host') });
-                       args.response.success({data: scope});
-                    }
+                      args.response.success({
+                        data: scope
+                      });
 
                 }
 


[13/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
LOUDSTACK-1065: cloudstack UI - AWS Style Regions - handle the case that document.location.href includes bookmark # that doesn't match region's end point completely.


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

Branch: refs/heads/marvin_refactor
Commit: e0a0c1f75ad5c4f5fa26f4f84dbe3558d283e467
Parents: 7c02636
Author: Jessica Wang <je...@citrix.com>
Authored: Wed Mar 20 16:41:26 2013 -0700
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:02:01 2013 +0530

----------------------------------------------------------------------
 ui/scripts/regions.js           |   10 +++++++---
 ui/scripts/ui-custom/regions.js |   18 +++++++++---------
 2 files changed, 16 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e0a0c1f7/ui/scripts/regions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/regions.js b/ui/scripts/regions.js
index edc96cb..a271a1a 100644
--- a/ui/scripts/regions.js
+++ b/ui/scripts/regions.js
@@ -28,8 +28,7 @@
             args.response.success({
               data: regions ? regions : [
                 { id: -1, name: '(Default)' }
-              ],
-              activeRegionID: cloudStack.context.users[0].regionid
+              ]
             });
           }
         }); 
@@ -126,7 +125,12 @@
             },
 						preAction: function(args) {
 						  var region = args.context.regions[0];
-							if(region.endpoint == document.location.href) {
+
+							/* e.g.
+							region.endpoint	== "http://localhost:8080/client/"
+							document.location.href == "http://localhost:8080/client/#"
+							*/
+							if(document.location.href.indexOf(region.endpoint) != -1) {
 							  cloudStack.dialog.notice({ message: _l('You can not remove the region that you are currently in.') });
                 return false;
 							}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e0a0c1f7/ui/scripts/ui-custom/regions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/regions.js b/ui/scripts/ui-custom/regions.js
index 819dfd0..9c139e5 100644
--- a/ui/scripts/ui-custom/regions.js
+++ b/ui/scripts/ui-custom/regions.js
@@ -27,9 +27,8 @@
         response: {
           success: function(args) {
             var data = args.data;
-            var activeRegionID = args.activeRegionID;
 
-						var currentRegion;
+						var currentRegion = null;
             $(data).each(function() {
               var region = this;
               var regionName = region.name;
@@ -37,20 +36,21 @@
 
               $li.data('region-data', region);
 
-							if(region.endpoint == document.location.href) {
+							/* e.g.
+							region.endpoint	== "http://localhost:8080/client/"
+							document.location.href == "http://localhost:8080/client/#"
+							*/
+							if(document.location.href.indexOf(region.endpoint) != -1) {
                 currentRegion = region;
 								$li.addClass('active');
 							}
-							/*
-              if (region.id == activeRegionID) {
-                $li.addClass('active');
-              }
-              */
 
               $regionList.append($li);
             });
 
-						$regionSwitcherButton.find('.title').html(_s(currentRegion.name)).attr('title', _s(currentRegion.name));
+            if(currentRegion != null)	{
+						  $regionSwitcherButton.find('.title').html(_s(currentRegion.name)).attr('title', _s(currentRegion.name));
+            }
           }
         }
       });


[39/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
Factories for DiskOffering, ServiceOffering

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


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

Branch: refs/heads/marvin_refactor
Commit: be71fae9b4854a2b83064be0f12fc359612f7d1a
Parents: ed291ee
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Sat Mar 30 22:16:39 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:19:28 2013 +0530

----------------------------------------------------------------------
 .../marvin/marvin/integration/lib/base/Account.py  |    2 +-
 .../integration/lib/factory/AccountFactory.py      |    2 +-
 .../integration/lib/factory/DiskOfferingFactory.py |   21 ++++++++-
 .../integration/lib/factory/DomainFactory.py       |    3 +-
 .../lib/factory/NetworkOfferingFactory.py          |   13 +++--
 .../lib/factory/ServiceOfferingFactory.py          |   25 ++++++++---
 .../integration/lib/factory/test/testFactories.py  |   34 +++++++++++---
 7 files changed, 75 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be71fae9/tools/marvin/marvin/integration/lib/base/Account.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Account.py b/tools/marvin/marvin/integration/lib/base/Account.py
index b5ad12a..c9698eb 100644
--- a/tools/marvin/marvin/integration/lib/base/Account.py
+++ b/tools/marvin/marvin/integration/lib/base/Account.py
@@ -23,7 +23,7 @@ from marvin.cloudstackAPI import updateAccount
 from marvin.cloudstackAPI import disableAccount
 from marvin.cloudstackAPI import deleteAccount
 
-class Account(CloudStackEntity):
+class Account(CloudStackEntity.CloudStackEntity):
 
 
     def __init__(self, items):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be71fae9/tools/marvin/marvin/integration/lib/factory/AccountFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/AccountFactory.py b/tools/marvin/marvin/integration/lib/factory/AccountFactory.py
index ebff3fe..7306073 100644
--- a/tools/marvin/marvin/integration/lib/factory/AccountFactory.py
+++ b/tools/marvin/marvin/integration/lib/factory/AccountFactory.py
@@ -15,9 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from marvin.integration.lib.base import Account
 import hashlib
 from marvin.integration.lib.factory.CloudStackBaseFactory import *
+from marvin.integration.lib.base import Account
 from marvin.integration.lib.utils import random_gen
 
 class AccountFactory(CloudStackBaseFactory):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be71fae9/tools/marvin/marvin/integration/lib/factory/DiskOfferingFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/DiskOfferingFactory.py b/tools/marvin/marvin/integration/lib/factory/DiskOfferingFactory.py
index df3ef3e..11c4df8 100644
--- a/tools/marvin/marvin/integration/lib/factory/DiskOfferingFactory.py
+++ b/tools/marvin/marvin/integration/lib/factory/DiskOfferingFactory.py
@@ -16,9 +16,26 @@
 # under the License.
 import factory
 from marvin.integration.lib.base import DiskOffering
+from marvin.integration.lib.utils import random_gen
+
 class DiskOfferingFactory(factory.Factory):
 
     FACTORY_FOR = DiskOffering
 
-    displaytext = None
-    name = None
+    displaytext = factory.Sequence(lambda n : "DiskOffering" + random_gen())
+    name = factory.Sequence(lambda n : "DiskOffering" + random_gen())
+
+
+class SharedDiskOfferingFactory(DiskOfferingFactory):
+
+    displaytext = "SharedDiskOffering"
+    name = factory.Sequence(lambda n : "SharedDiskOffering" + random_gen())
+    storagetype = "shared"
+    disksize = 10 #MB
+
+class LocalDiskOfferingFactory(DiskOfferingFactory):
+
+    displaytext = "LocalDiskOffering"
+    name = factory.Sequence(lambda n : "LocalDiskOffering" + random_gen())
+    storagetype = "local"
+    disksize = 10 #MB

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be71fae9/tools/marvin/marvin/integration/lib/factory/DomainFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/DomainFactory.py b/tools/marvin/marvin/integration/lib/factory/DomainFactory.py
index 9f5158e..1c51170 100644
--- a/tools/marvin/marvin/integration/lib/factory/DomainFactory.py
+++ b/tools/marvin/marvin/integration/lib/factory/DomainFactory.py
@@ -16,8 +16,9 @@
 # under the License.
 import factory
 from marvin.integration.lib.base import Domain
+from marvin.integration.lib.utils import random_gen
 class DomainFactory(factory.Factory):
 
     FACTORY_FOR = Domain
 
-    name = None
+    name = "Domain" + factory.Sequence(lambda n : random_gen())

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be71fae9/tools/marvin/marvin/integration/lib/factory/NetworkOfferingFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/NetworkOfferingFactory.py b/tools/marvin/marvin/integration/lib/factory/NetworkOfferingFactory.py
index 7736281..5f876c8 100644
--- a/tools/marvin/marvin/integration/lib/factory/NetworkOfferingFactory.py
+++ b/tools/marvin/marvin/integration/lib/factory/NetworkOfferingFactory.py
@@ -20,8 +20,11 @@ class NetworkOfferingFactory(factory.Factory):
 
     FACTORY_FOR = NetworkOffering
 
-    displaytext = None
-    guestiptype = None
-    name = None
-    supportedservices = None
-    traffictype = None
+    displaytext = "Network Offering"
+    guestiptype = "Isolated"
+    name = "Network Offering"
+    supportedservices = "Dhcp,Dns,SourceNat,PortForwarding"
+    traffictype = "Guest"
+
+
+class DefaultIsolatedNetworkOffering

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be71fae9/tools/marvin/marvin/integration/lib/factory/ServiceOfferingFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/ServiceOfferingFactory.py b/tools/marvin/marvin/integration/lib/factory/ServiceOfferingFactory.py
index fb85187..a0b4295 100644
--- a/tools/marvin/marvin/integration/lib/factory/ServiceOfferingFactory.py
+++ b/tools/marvin/marvin/integration/lib/factory/ServiceOfferingFactory.py
@@ -15,13 +15,24 @@
 # specific language governing permissions and limitations
 # under the License.
 import factory
+from marvin.integration.lib.factory.CloudStackBaseFactory import *
 from marvin.integration.lib.base import ServiceOffering
-class ServiceOfferingFactory(factory.Factory):
+from marvin.integration.lib.utils import random_gen
 
-    FACTORY_FOR = ServiceOffering
+class ServiceOfferingFactory(CloudStackBaseFactory):
 
-    cpunumber = None
-    cpuspeed = None
-    displaytext = None
-    memory = None
-    name = None
+    FACTORY_FOR = ServiceOffering.ServiceOffering
+
+    cpunumber = 1
+    cpuspeed = 1000 #Mhz
+    displaytext = "Service Offering"
+    memory = 512 #MB
+    name =  factory.Sequence(lambda n: "ServiceOffering" + random_gen())
+
+
+class SmallServiceOfferingFactory(ServiceOfferingFactory):
+    cpunumber = 1
+    cpuspeed = 100 #Mhz
+    memory = 100 #MB
+    displaytext = "Small Service Offering"
+    name = factory.Sequence(lambda n: "SmallServiceOffering" + random_gen())

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be71fae9/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/test/testFactories.py b/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
index 551d7f6..d8afb03 100644
--- a/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
+++ b/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
@@ -16,8 +16,11 @@
 # under the License.
 
 import unittest
-from marvin.integration.lib.factory import AccountFactory
-from marvin.integration.lib.base import Account
+from marvin.integration.lib.factory.AccountFactory import *
+from marvin.integration.lib.base.Account import *
+
+from marvin.integration.lib.factory.ServiceOfferingFactory import *
+from marvin.integration.lib.base.ServiceOffering import *
 from marvin.cloudstackTestClient import cloudstackTestClient
 
 class AccountFactoryTest(unittest.TestCase):
@@ -25,22 +28,37 @@ class AccountFactoryTest(unittest.TestCase):
         self.apiClient = cloudstackTestClient(mgtSvr='localhost').getApiClient()
 
     def test_userAccountFactory(self):
-        af = AccountFactory.AccountFactory()
-        accnt = Account.Account.create(apiclient=self.apiClient, AccountFactory=af)
+        af = AccountFactory()
+        accnt = Account.create(apiclient=self.apiClient, AccountFactory=af)
         self.assertTrue(accnt is not None, msg="no account created by factory")
         self.assertEqual(accnt.name, af.username, msg="account names are not same")
 
     def test_adminAccountFactory(self):
-        af = AccountFactory.AccountFactory()
-        accnt = Account.Account.create(apiclient=self.apiClient, AccountFactory=af)
+        af = AdminAccountFactory()
+        accnt = Account.create(apiclient=self.apiClient, AccountFactory=af)
         self.assertTrue(accnt is not None, msg="no account created by factory")
         self.assertEqual(accnt.name, af.username, msg="account names are not same")
 
     def test_userAccountFactoryCustomArgs(self):
-        af = AccountFactory.AccountFactory(firstname='test', lastname='test')
-        accnt = Account.Account.create(apiclient=self.apiClient, AccountFactory=af)
+        af = AccountFactory(firstname='test', lastname='test')
+        accnt = Account.create(apiclient=self.apiClient, AccountFactory=af)
         self.assertTrue(accnt is not None, msg="no account created by factory")
         self.assertEqual(accnt.name, af.username, msg="account names are not same")
 
     def tearDown(self):
         pass
+
+
+class ServiceOfferingFactoryTest(unittest.TestCase):
+    def setUp(self):
+        self.apiClient = cloudstackTestClient(mgtSvr='localhost').getApiClient()
+
+    def test_serviceOfferingFactory(self):
+        sf = ServiceOfferingFactory()
+        soffering = ServiceOffering.create(apiclient=self.apiClient, ServiceOfferingFactory=sf)
+        self.assertTrue(soffering is not None, msg="no service offering was created")
+        self.assertEqual(soffering.name, sf.name, msg="error in service offering factory creation")
+
+
+    def tearDown(self):
+        pass
\ No newline at end of file


[26/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
CLOUDSTACK-1795: implement custom AOP to fully support legacy CloudStack AOP semantcis
Signed-off-by: Chip Childers <ch...@gmail.com>


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

Branch: refs/heads/marvin_refactor
Commit: 07a63a89b671efb50a05d39d951a0a20cbdafdac
Parents: 646c4fb
Author: Kelven Yang <ke...@gmail.com>
Authored: Wed Mar 27 13:06:49 2013 +0000
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:07:09 2013 +0530

----------------------------------------------------------------------
 client/tomcatconf/applicationContext.xml.in        |   27 +-
 server/src/com/cloud/api/ApiDispatcher.java        |  280 +++++++--------
 .../src/com/cloud/network/NetworkManagerImpl.java  |   16 +-
 server/src/com/cloud/network/NetworkModelImpl.java |    6 +-
 .../src/com/cloud/utils/component/AdapterBase.java |    2 +-
 .../cloud/utils/component/ComponentContext.java    |   40 +-
 .../ComponentInstantiationPostProcessor.java       |   24 +-
 .../component/ComponentMethodInterceptor.java      |    2 +-
 .../utils/component/ComponentNamingPolicy.java     |    6 +-
 utils/src/com/cloud/utils/db/GenericDaoBase.java   |    2 +-
 .../cloud/utils/db/TransactionContextBuilder.java  |   24 +-
 utils/test/resources/testContext.xml               |   16 +-
 12 files changed, 213 insertions(+), 232 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/07a63a89/client/tomcatconf/applicationContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/applicationContext.xml.in b/client/tomcatconf/applicationContext.xml.in
index da7a380..250d5ef 100644
--- a/client/tomcatconf/applicationContext.xml.in
+++ b/client/tomcatconf/applicationContext.xml.in
@@ -35,27 +35,18 @@
   <!--
     @DB support
   -->
-  <aop:config>
-    <aop:aspect id="dbContextBuilder" ref="transactionContextBuilder">
-        <aop:pointcut id="captureAnyMethod"
-            expression="execution(* *(..))" 
-        />
-        
-        <aop:around pointcut-ref="captureAnyMethod" method="AroundAnyMethod"/> 
-    </aop:aspect>
-
-    <aop:aspect id="actionEventInterceptorAspect" ref="actionEventInterceptor">
-        <aop:pointcut id="captureEventMethod"
-            expression="execution(* *(..)) and @annotation(com.cloud.event.ActionEvent)" 
-        />
-
-        <aop:around pointcut-ref="captureEventMethod" method="AroundAnyMethod"/> 
-    </aop:aspect>
-  </aop:config>
-
   <bean id="transactionContextBuilder" class="com.cloud.utils.db.TransactionContextBuilder" />
   <bean id="actionEventInterceptor" class="com.cloud.event.ActionEventInterceptor" />
 
+  <bean id="instantiatePostProcessor" class="com.cloud.utils.component.ComponentInstantiationPostProcessor">
+    <property name="Interceptors">
+        <list>
+            <ref bean="transactionContextBuilder" />
+            <ref bean="actionEventInterceptor" />
+        </list>
+    </property>
+  </bean>
+
   <!--
     RPC/Async/EventBus
   -->

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/07a63a89/server/src/com/cloud/api/ApiDispatcher.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiDispatcher.java b/server/src/com/cloud/api/ApiDispatcher.java
index f7d881d..925d90a 100755
--- a/server/src/com/cloud/api/ApiDispatcher.java
+++ b/server/src/com/cloud/api/ApiDispatcher.java
@@ -31,91 +31,86 @@ import java.util.Set;
 import java.util.StringTokenizer;
 import java.util.regex.Matcher;
 
-import com.cloud.dao.EntityManager;
-import com.cloud.utils.ReflectUtil;
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+
 import org.apache.cloudstack.acl.ControlledEntity;
 import org.apache.cloudstack.acl.InfrastructureEntity;
-import org.apache.cloudstack.acl.Role;
-import org.apache.cloudstack.api.*;
-import org.apache.log4j.Logger;
-
+import org.apache.cloudstack.acl.SecurityChecker.AccessType;
+import org.apache.cloudstack.api.ACL;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.BaseAsyncCreateCmd;
+import org.apache.cloudstack.api.BaseCmd;
 import org.apache.cloudstack.api.BaseCmd.CommandType;
+import org.apache.cloudstack.api.BaseListCmd;
+import org.apache.cloudstack.api.EntityReference;
+import org.apache.cloudstack.api.InternalIdentity;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.Validate;
+import org.apache.cloudstack.api.command.user.event.ArchiveEventsCmd;
+import org.apache.cloudstack.api.command.user.event.DeleteEventsCmd;
 import org.apache.cloudstack.api.command.user.event.ListEventsCmd;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
 import com.cloud.async.AsyncCommandQueued;
 import com.cloud.async.AsyncJobManager;
-import com.cloud.configuration.Config;
-import com.cloud.configuration.dao.ConfigurationDao;
+import com.cloud.dao.EntityManager;
 import com.cloud.exception.AccountLimitException;
 import com.cloud.exception.InsufficientCapacityException;
 import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.exception.PermissionDeniedException;
 import com.cloud.exception.ResourceAllocationException;
 import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.network.dao.NetworkDao;
-import com.cloud.server.ManagementServer;
-import com.cloud.storage.dao.VMTemplateDao;
 import com.cloud.user.Account;
 import com.cloud.user.AccountManager;
 import com.cloud.user.UserContext;
 import com.cloud.utils.DateUtil;
-import com.cloud.utils.NumbersUtil;
-import com.cloud.utils.component.ComponentLocator;
-import com.cloud.utils.component.Inject;
-import com.cloud.utils.component.PluggableService;
-import com.cloud.utils.db.GenericDao;
+import com.cloud.utils.ReflectUtil;
+import com.cloud.utils.component.ComponentContext;
 import com.cloud.utils.exception.CSExceptionErrorCode;
 import com.cloud.utils.exception.CloudRuntimeException;
 
-// ApiDispatcher: A class that dispatches API commands to the appropriate manager for execution.
+@Component
 public class ApiDispatcher {
     private static final Logger s_logger = Logger.getLogger(ApiDispatcher.class.getName());
 
-    ComponentLocator _locator;
     Long _createSnapshotQueueSizeLimit;
-    @Inject private AsyncJobManager _asyncMgr = null;
-    @Inject private AccountManager _accountMgr = null;
+    @Inject AsyncJobManager _asyncMgr = null;
+    @Inject AccountManager _accountMgr = null;
     @Inject EntityManager _entityMgr = null;
 
-    Map<String, Class<? extends GenericDao>> _daoNameMap = new HashMap<String, Class<? extends GenericDao>>();
-    // singleton class
-    private static ApiDispatcher s_instance = ApiDispatcher.getInstance();
+    private static ApiDispatcher s_instance;
 
     public static ApiDispatcher getInstance() {
-        if (s_instance == null) {
-            s_instance = ComponentLocator.inject(ApiDispatcher.class);
-        }
         return s_instance;
     }
 
-    protected ApiDispatcher() {
-        super();
-        _locator = ComponentLocator.getLocator(ManagementServer.Name);
-        ConfigurationDao configDao = _locator.getDao(ConfigurationDao.class);
-        Map<String, String> configs = configDao.getConfiguration();
-        String strSnapshotLimit = configs.get(Config.ConcurrentSnapshotsThresholdPerHost.key());
-        if (strSnapshotLimit != null) {
-            Long snapshotLimit = NumbersUtil.parseLong(strSnapshotLimit, 1L);
-            if (snapshotLimit <= 0) {
-                s_logger.debug("Global config parameter " + Config.ConcurrentSnapshotsThresholdPerHost.toString()
-                        + " is less or equal 0; defaulting to unlimited");
-            } else {
-                _createSnapshotQueueSizeLimit = snapshotLimit;
-            }
-        }
-        _daoNameMap.put("com.cloud.network.Network", NetworkDao.class);
-        _daoNameMap.put("com.cloud.template.VirtualMachineTemplate", VMTemplateDao.class);
+    public ApiDispatcher() {
+    }
+
+    @PostConstruct
+    void init() {
+    	s_instance = this;
+    }
+
+    public void setCreateSnapshotQueueSizeLimit(Long snapshotLimit) {
+        _createSnapshotQueueSizeLimit = snapshotLimit;
     }
 
     public void dispatchCreateCmd(BaseAsyncCreateCmd cmd, Map<String, String> params) throws Exception {
         processParameters(cmd, params);
 
-        UserContext ctx = UserContext.current();
-        ctx.setAccountId(cmd.getEntityOwnerId());
-        cmd.create();
+            UserContext ctx = UserContext.current();
+            ctx.setAccountId(cmd.getEntityOwnerId());
+            cmd.create();
 
     }
 
-    private void doAccessChecks(BaseCmd cmd, List<Object> entitiesToAccess) {
+    private void doAccessChecks(BaseCmd cmd, Map<Object, AccessType> entitiesToAccess) {
         Account caller = UserContext.current().getCaller();
         Account owner = _accountMgr.getActiveAccountById(cmd.getEntityOwnerId());
 
@@ -127,9 +122,9 @@ public class ApiDispatcher {
         if(!entitiesToAccess.isEmpty()){
             //check that caller can access the owner account.
             _accountMgr.checkAccess(caller, null, true, owner);
-            for(Object entity : entitiesToAccess) {
+            for (Object entity : entitiesToAccess.keySet()) {
                 if (entity instanceof ControlledEntity) {
-                    _accountMgr.checkAccess(caller, null, true, (ControlledEntity) entity);
+                    _accountMgr.checkAccess(caller, entitiesToAccess.get(entity), true, (ControlledEntity) entity);
                 }
                 else if (entity instanceof InfrastructureEntity) {
                     //FIXME: Move this code in adapter, remove code from Account manager
@@ -139,39 +134,40 @@ public class ApiDispatcher {
     }
 
     public void dispatch(BaseCmd cmd, Map<String, String> params) throws Exception {
-        processParameters(cmd, params);
-        UserContext ctx = UserContext.current();
-        ctx.setAccountId(cmd.getEntityOwnerId());
-        if (cmd instanceof BaseAsyncCmd) {
-
-            BaseAsyncCmd asyncCmd = (BaseAsyncCmd) cmd;
-            String startEventId = params.get("ctxStartEventId");
-            ctx.setStartEventId(Long.valueOf(startEventId));
-
-            // Synchronise job on the object if needed
-            if (asyncCmd.getJob() != null && asyncCmd.getSyncObjId() != null && asyncCmd.getSyncObjType() != null) {
-                Long queueSizeLimit = null;
-                if (asyncCmd.getSyncObjType() != null && asyncCmd.getSyncObjType().equalsIgnoreCase(BaseAsyncCmd.snapshotHostSyncObject)) {
-                    queueSizeLimit = _createSnapshotQueueSizeLimit;
-                } else {
-                    queueSizeLimit = 1L;
-                }
+            processParameters(cmd, params);
+            UserContext ctx = UserContext.current();
+            ctx.setAccountId(cmd.getEntityOwnerId());
+            
+            if (cmd instanceof BaseAsyncCmd) {
+
+                BaseAsyncCmd asyncCmd = (BaseAsyncCmd) cmd;
+                String startEventId = params.get("ctxStartEventId");
+                ctx.setStartEventId(Long.valueOf(startEventId));
+
+                // Synchronise job on the object if needed
+                if (asyncCmd.getJob() != null && asyncCmd.getSyncObjId() != null && asyncCmd.getSyncObjType() != null) {
+                    Long queueSizeLimit = null;
+                    if (asyncCmd.getSyncObjType() != null && asyncCmd.getSyncObjType().equalsIgnoreCase(BaseAsyncCmd.snapshotHostSyncObject)) {
+                        queueSizeLimit = _createSnapshotQueueSizeLimit;
+                    } else {
+                        queueSizeLimit = 1L;
+                    }
 
-                if (queueSizeLimit != null) {
+                    if (queueSizeLimit != null) {
                     _asyncMgr.syncAsyncJobExecution(asyncCmd.getJob(), asyncCmd.getSyncObjType(), asyncCmd.getSyncObjId().longValue(), queueSizeLimit);
-                } else {
-                    s_logger.trace("The queue size is unlimited, skipping the synchronizing");
+                    } else {
+                        s_logger.trace("The queue size is unlimited, skipping the synchronizing");
+                    }
                 }
             }
-        }
 
-        cmd.execute();
+            cmd.execute();
 
     }
 
     @SuppressWarnings({ "unchecked", "rawtypes" })
-	public static void processParameters(BaseCmd cmd, Map<String, String> params) {
-        List<Object> entitiesToAccess = new ArrayList<Object>();
+    public static void processParameters(BaseCmd cmd, Map<String, String> params) {
+        Map<Object, AccessType> entitiesToAccess = new HashMap<Object, AccessType>();
         Map<String, Object> unpackedParams = cmd.unpackParams(params);
 
         if (cmd instanceof BaseListCmd) {
@@ -184,7 +180,7 @@ public class ApiDispatcher {
             if ((unpackedParams.get(ApiConstants.PAGE) == null) && (pageSize != null && pageSize != BaseListCmd.PAGESIZE_UNLIMITED)) {
                 ServerApiException ex = new ServerApiException(ApiErrorCode.PARAM_ERROR, "\"page\" parameter is required when \"pagesize\" is specified");
                 ex.setCSErrorCode(CSExceptionErrorCode.getCSErrCode(ex.getClass().getName()));
-            	throw ex;
+                throw ex;
             } else if (pageSize == null && (unpackedParams.get(ApiConstants.PAGE) != null)) {
                 throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "\"pagesize\" parameter is required when \"page\" is specified");
             }
@@ -193,11 +189,6 @@ public class ApiDispatcher {
         List<Field> fields = ReflectUtil.getAllFieldsForClass(cmd.getClass(), BaseCmd.class);
 
         for (Field field : fields) {
-            PlugService plugServiceAnnotation = field.getAnnotation(PlugService.class);
-            if(plugServiceAnnotation != null){
-                plugService(field, cmd);
-            }
-
             Parameter parameterAnnotation = field.getAnnotation(Parameter.class);
             if ((parameterAnnotation == null) || !parameterAnnotation.expose()) {
                 continue;
@@ -233,15 +224,16 @@ public class ApiDispatcher {
             } catch (InvalidParameterValueException invEx) {
                 throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Unable to execute API command " + cmd.getCommandName().substring(0, cmd.getCommandName().length() - 8) + " due to invalid value. " + invEx.getMessage());
             } catch (CloudRuntimeException cloudEx) {
+            	s_logger.error("CloudRuntimeException", cloudEx);
                 // FIXME: Better error message? This only happens if the API command is not executable, which typically
-            	//means
+                //means
                 // there was
                 // and IllegalAccessException setting one of the parameters.
                 throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Internal error executing API command " + cmd.getCommandName().substring(0, cmd.getCommandName().length() - 8));
             }
 
             //check access on the resource this field points to
-	        try {
+            try {
                 ACL checkAccess = field.getAnnotation(ACL.class);
                 CommandType fieldType = parameterAnnotation.type();
 
@@ -261,17 +253,17 @@ public class ApiDispatcher {
                             // Check if the parameter type is a single
                             // Id or list of id's/name's
                             switch (fieldType) {
-                                case LIST:
-                                    CommandType listType = parameterAnnotation.collectionType();
-                                    switch (listType) {
-                                        case LONG:
-                                        case UUID:
-                                            List<Long> listParam = (List<Long>) field.get(cmd);
-                                            for (Long entityId : listParam) {
-                                                Object entityObj = s_instance._entityMgr.findById(entity, entityId);
-                                                entitiesToAccess.add(entityObj);
-                                            }
-                                            break;
+                            case LIST:
+                                CommandType listType = parameterAnnotation.collectionType();
+                                switch (listType) {
+                                case LONG:
+                                case UUID:
+                                    List<Long> listParam = (List<Long>) field.get(cmd);
+                                    for (Long entityId : listParam) {
+                                        Object entityObj = s_instance._entityMgr.findById(entity, entityId);
+                                        entitiesToAccess.put(entityObj, checkAccess.accessType());
+                                    }
+                                    break;
                                     /*
                                      * case STRING: List<String> listParam =
                                      * new ArrayList<String>(); listParam =
@@ -283,17 +275,17 @@ public class ApiDispatcher {
                                      * entitiesToAccess.add(entityObj); }
                                      * break;
                                      */
-                                        default:
-                                            break;
-                                    }
-                                    break;
-                                case LONG:
-                                case UUID:
-                                    Object entityObj = s_instance._entityMgr.findById(entity, (Long) field.get(cmd));
-                                    entitiesToAccess.add(entityObj);
-                                    break;
                                 default:
                                     break;
+                                }
+                                break;
+                            case LONG:
+                            case UUID:
+                                Object entityObj = s_instance._entityMgr.findById(entity, (Long) field.get(cmd));
+                                entitiesToAccess.put(entityObj, checkAccess.accessType());
+                                break;
+                            default:
+                                break;
                             }
 
                             if (ControlledEntity.class.isAssignableFrom(entity)) {
@@ -309,22 +301,22 @@ public class ApiDispatcher {
                             }
                         }
 
-	            	}
+                    }
 
-	            }
+                }
 
-			} catch (IllegalArgumentException e) {
-	            s_logger.error("Error initializing command " + cmd.getCommandName() + ", field " + field.getName() + " is not accessible.");
-	            throw new CloudRuntimeException("Internal error initializing parameters for command " + cmd.getCommandName() + " [field " + field.getName() + " is not accessible]");
-			} catch (IllegalAccessException e) {
-	            s_logger.error("Error initializing command " + cmd.getCommandName() + ", field " + field.getName() + " is not accessible.");
-	            throw new CloudRuntimeException("Internal error initializing parameters for command " + cmd.getCommandName() + " [field " + field.getName() + " is not accessible]");
-			}
+            } catch (IllegalArgumentException e) {
+                s_logger.error("Error initializing command " + cmd.getCommandName() + ", field " + field.getName() + " is not accessible.");
+                throw new CloudRuntimeException("Internal error initializing parameters for command " + cmd.getCommandName() + " [field " + field.getName() + " is not accessible]");
+            } catch (IllegalAccessException e) {
+                s_logger.error("Error initializing command " + cmd.getCommandName() + ", field " + field.getName() + " is not accessible.");
+                throw new CloudRuntimeException("Internal error initializing parameters for command " + cmd.getCommandName() + " [field " + field.getName() + " is not accessible]");
+            }
 
         }
 
         //check access on the entities.
-        s_instance.doAccessChecks(cmd, entitiesToAccess);
+        getInstance().doAccessChecks(cmd, entitiesToAccess);
 
     }
 
@@ -368,7 +360,7 @@ public class ApiDispatcher {
             // Invoke the getId method, get the internal long ID
             // If that fails hide exceptions as the uuid may not exist
             try {
-                internalId = (Long) ((InternalIdentity)objVO).getId();
+                internalId = ((InternalIdentity)objVO).getId();
             } catch (IllegalArgumentException e) {
             } catch (NullPointerException e) {
             }
@@ -379,8 +371,8 @@ public class ApiDispatcher {
         if (internalId == null) {
             if (s_logger.isDebugEnabled())
                 s_logger.debug("Object entity uuid = " + uuid + " does not exist in the database.");
-            throw new InvalidParameterValueException("Invalid parameter value=" + uuid
-                + " due to incorrect long value format, or entity was not found as it may have been deleted, or due to incorrect parameter annotation for the field in api cmd.");
+            throw new InvalidParameterValueException("Invalid parameter " + annotation.name() + " value=" + uuid
+                + " due to incorrect long value format, or entity does not exist or due to incorrect parameter annotation for the field in api cmd class.");
         }
         return internalId;
     }
@@ -398,7 +390,7 @@ public class ApiDispatcher {
                 // This piece of code is for maintaining backward compatibility
                 // and support both the date formats(Bug 9724)
                 // Do the date messaging for ListEventsCmd only
-                if (cmdObj instanceof ListEventsCmd) {
+                if (cmdObj instanceof ListEventsCmd || cmdObj instanceof DeleteEventsCmd || cmdObj instanceof ArchiveEventsCmd) {
                     boolean isObjInNewDateFormat = isObjInNewDateFormat(paramObj.toString());
                     if (isObjInNewDateFormat) {
                         DateFormat newFormat = BaseCmd.NEW_INPUT_FORMAT;
@@ -413,6 +405,8 @@ public class ApiDispatcher {
                                 date = messageDate(date, 0, 0, 0);
                             } else if (field.getName().equals("endDate")) {
                                 date = messageDate(date, 23, 59, 59);
+                            } else if (field.getName().equals("olderThan")) {
+                                date = messageDate(date, 0, 0, 0);
                             }
                             field.set(cmdObj, date);
                         }
@@ -441,35 +435,35 @@ public class ApiDispatcher {
                     field.set(cmdObj, Integer.valueOf(paramObj.toString()));
                 }
                 break;
-                case LIST:
-                    List listParam = new ArrayList();
-                    StringTokenizer st = new StringTokenizer(paramObj.toString(), ",");
-                    while (st.hasMoreTokens()) {
-                        String token = st.nextToken();
-                        CommandType listType = annotation.collectionType();
-                        switch (listType) {
-                            case INTEGER:
-                                listParam.add(Integer.valueOf(token));
-                                break;
-                            case UUID:
-                                if (token.isEmpty())
-                                    break;
-                                Long internalId = translateUuidToInternalId(token, annotation);
-                                listParam.add(internalId);
-                                break;
-                            case LONG: {
-                                listParam.add(Long.valueOf(token));
-                            }
+            case LIST:
+                List listParam = new ArrayList();
+                StringTokenizer st = new StringTokenizer(paramObj.toString(), ",");
+                while (st.hasMoreTokens()) {
+                    String token = st.nextToken();
+                    CommandType listType = annotation.collectionType();
+                    switch (listType) {
+                    case INTEGER:
+                        listParam.add(Integer.valueOf(token));
+                        break;
+                    case UUID:
+                        if (token.isEmpty())
                             break;
-                            case SHORT:
-                                listParam.add(Short.valueOf(token));
-                            case STRING:
-                                listParam.add(token);
-                                break;
-                        }
+                        Long internalId = translateUuidToInternalId(token, annotation);
+                        listParam.add(internalId);
+                        break;
+                    case LONG: {
+                        listParam.add(Long.valueOf(token));
                     }
-                    field.set(cmdObj, listParam);
                     break;
+                    case SHORT:
+                        listParam.add(Short.valueOf(token));
+                    case STRING:
+                        listParam.add(token);
+                        break;
+                    }
+                }
+                field.set(cmdObj, listParam);
+                break;
             case UUID:
                 if (paramObj.toString().isEmpty())
                     break;
@@ -518,13 +512,9 @@ public class ApiDispatcher {
     }
 
     public static void plugService(Field field, BaseCmd cmd) {
-        ComponentLocator locator = ComponentLocator.getLocator(ManagementServer.Name);
 
         Class<?> fc = field.getType();
         Object instance = null;
-        if (PluggableService.class.isAssignableFrom(fc)) {
-            instance = locator.getPluggableService(fc);
-        }
 
         if (instance == null) {
             throw new CloudRuntimeException("Unable to plug service " + fc.getSimpleName() + " in command " + cmd.getClass().getSimpleName());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/07a63a89/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java
index d77aa1f..e980b0f 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -611,10 +611,10 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
                 }
                 IpDeployer deployer = null;
                 NetworkElement element = _networkModel.getElementImplementingProvider(provider.getName());
-                if (!(ComponentContext.getTargetObject(element) instanceof IpDeployingRequester)) {
+                if (!(element instanceof IpDeployingRequester)) {
                     throw new CloudRuntimeException("Element " + element + " is not a IpDeployingRequester!");
                 }
-                deployer = ((IpDeployingRequester)ComponentContext.getTargetObject(element)).getIpDeployer(network);
+                deployer = ((IpDeployingRequester)element).getIpDeployer(network);
                 if (deployer == null) {
                     throw new CloudRuntimeException("Fail to get ip deployer for element: " + element);
                 }
@@ -1594,13 +1594,13 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
         if (vmProfile.getType() == Type.User && element.getProvider() != null) {
             if (_networkModel.areServicesSupportedInNetwork(network.getId(), Service.Dhcp) &&
                     _networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.Dhcp, element.getProvider()) &&
-                    (ComponentContext.getTargetObject(element) instanceof DhcpServiceProvider)) {
+                    element instanceof DhcpServiceProvider) {
                 DhcpServiceProvider sp = (DhcpServiceProvider) element;
                 sp.addDhcpEntry(network, profile, vmProfile, dest, context);
             }
             if (_networkModel.areServicesSupportedInNetwork(network.getId(), Service.UserData) &&
                     _networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.UserData, element.getProvider()) &&
-                    (ComponentContext.getTargetObject(element) instanceof UserDataServiceProvider)) {
+                    element instanceof UserDataServiceProvider) {
                 UserDataServiceProvider sp = (UserDataServiceProvider) element;
                 sp.addPasswordAndUserdata(network, profile, vmProfile, dest, context);
             }
@@ -3678,15 +3678,15 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
     @Override
     public StaticNatServiceProvider getStaticNatProviderForNetwork(Network network) {
         NetworkElement element = getElementForServiceInNetwork(network, Service.StaticNat);
-        assert ComponentContext.getTargetObject(element) instanceof StaticNatServiceProvider;
-        return (StaticNatServiceProvider)ComponentContext.getTargetObject(element);
+        assert element instanceof StaticNatServiceProvider;
+        return (StaticNatServiceProvider)element;
     }
 
     @Override
     public LoadBalancingServiceProvider getLoadBalancingProviderForNetwork(Network network) {
         NetworkElement element = getElementForServiceInNetwork(network, Service.Lb);
-        assert ComponentContext.getTargetObject(element) instanceof LoadBalancingServiceProvider; 
-        return ( LoadBalancingServiceProvider)ComponentContext.getTargetObject(element);
+        assert element instanceof LoadBalancingServiceProvider;
+        return (LoadBalancingServiceProvider)element;
     }
     @Override
     public boolean isNetworkInlineMode(Network network) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/07a63a89/server/src/com/cloud/network/NetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkModelImpl.java b/server/src/com/cloud/network/NetworkModelImpl.java
index e6361b0..e45818f 100644
--- a/server/src/com/cloud/network/NetworkModelImpl.java
+++ b/server/src/com/cloud/network/NetworkModelImpl.java
@@ -404,9 +404,9 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel {
         Network network = _networksDao.findById(networkId);
         NetworkElement oldElement = getElementImplementingProvider(oldProvider.getName());
         NetworkElement newElement = getElementImplementingProvider(newProvider.getName());
-        if (ComponentContext.getTargetObject(oldElement) instanceof IpDeployingRequester && ComponentContext.getTargetObject(newElement) instanceof IpDeployingRequester) {
-        	IpDeployer oldIpDeployer = ((IpDeployingRequester)ComponentContext.getTargetObject(oldElement)).getIpDeployer(network);
-        	IpDeployer newIpDeployer = ((IpDeployingRequester)ComponentContext.getTargetObject(newElement)).getIpDeployer(network);
+        if (oldElement instanceof IpDeployingRequester && newElement instanceof IpDeployingRequester) {
+		IpDeployer oldIpDeployer = ((IpDeployingRequester)oldElement).getIpDeployer(network);
+		IpDeployer newIpDeployer = ((IpDeployingRequester)newElement).getIpDeployer(network);
         	if (!oldIpDeployer.getProvider().getName().equals(newIpDeployer.getProvider().getName())) {
         		throw new InvalidParameterException("There would be multiple providers for IP " + publicIp.getAddress() + "!");
         	}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/07a63a89/utils/src/com/cloud/utils/component/AdapterBase.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/component/AdapterBase.java b/utils/src/com/cloud/utils/component/AdapterBase.java
index 8353cee..d161787 100644
--- a/utils/src/com/cloud/utils/component/AdapterBase.java
+++ b/utils/src/com/cloud/utils/component/AdapterBase.java
@@ -29,7 +29,7 @@ public class AdapterBase extends ComponentLifecycleBase implements Adapter, Comp
 	public static <T extends Adapter> T getAdapterByName(List<T> adapters, String name) {
     	for(T adapter : adapters) {
     		if(adapter.getName() != null && adapter.getName().equalsIgnoreCase(name))
-    			return adapter;
+			return adapter;
     	}
     	return null;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/07a63a89/utils/src/com/cloud/utils/component/ComponentContext.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/component/ComponentContext.java b/utils/src/com/cloud/utils/component/ComponentContext.java
index 796d4ec..32e4464 100644
--- a/utils/src/com/cloud/utils/component/ComponentContext.java
+++ b/utils/src/com/cloud/utils/component/ComponentContext.java
@@ -60,17 +60,17 @@ public class ComponentContext implements ApplicationContextAware {
     public static ApplicationContext getApplicationContext() {  
         return s_appContext;  
     }
-    
+
     public static void initComponentsLifeCycle() {
         AutowireCapableBeanFactory  beanFactory = s_appContext.getAutowireCapableBeanFactory();
 
-    	Map<String, ComponentMethodInterceptable> interceptableComponents = getApplicationContext().getBeansOfType(
-    		ComponentMethodInterceptable.class);
-    	for(Map.Entry<String, ComponentMethodInterceptable> entry : interceptableComponents.entrySet()) {
-    		Object bean = getTargetObject(entry.getValue());
-    		beanFactory.configureBean(bean, entry.getKey());
-    	}
-    	
+	Map<String, ComponentMethodInterceptable> interceptableComponents = getApplicationContext().getBeansOfType(
+		ComponentMethodInterceptable.class);
+	for(Map.Entry<String, ComponentMethodInterceptable> entry : interceptableComponents.entrySet()) {
+		Object bean = getTargetObject(entry.getValue());
+		beanFactory.configureBean(bean, entry.getKey());
+	}
+
     	Map<String, ComponentLifecycle> lifecyleComponents = getApplicationContext().getBeansOfType(ComponentLifecycle.class);
  
     	Map[] classifiedComponents = new Map[ComponentLifecycle.MAX_RUN_LEVELS];
@@ -81,18 +81,6 @@ public class ComponentContext implements ApplicationContextAware {
     	for(Map.Entry<String, ComponentLifecycle> entry : lifecyleComponents.entrySet()) {
     		classifiedComponents[entry.getValue().getRunLevel()].put(entry.getKey(), entry.getValue());
     	}
-
-        // Run the SystemIntegrityCheckers first
-        Map<String, SystemIntegrityChecker> integrityCheckers = getApplicationContext().getBeansOfType(SystemIntegrityChecker.class);
-        for (Entry<String,SystemIntegrityChecker> entry : integrityCheckers.entrySet() ){
-            s_logger.info ("Running SystemIntegrityChecker " + entry.getKey());
-            try {
-            	entry.getValue().check();
-            } catch(Throwable e) {
-            	s_logger.error("System integrity check failed. Refuse to startup");
-            	System.exit(1);
-            }
-        }
     	
     	// configuration phase
         Map<String, String> avoidMap = new HashMap<String, String>();
@@ -117,6 +105,18 @@ public class ComponentContext implements ApplicationContextAware {
                 avoidMap.put(implClassName, implClassName);
     		}
     	}
+
+        // Run the SystemIntegrityCheckers first
+        Map<String, SystemIntegrityChecker> integrityCheckers = getApplicationContext().getBeansOfType(SystemIntegrityChecker.class);
+        for (Entry<String,SystemIntegrityChecker> entry : integrityCheckers.entrySet() ){
+            s_logger.info ("Running SystemIntegrityChecker " + entry.getKey());
+            try {
+		entry.getValue().check();
+            } catch(Throwable e) {
+		s_logger.error("System integrity check failed. Refuse to startup");
+		System.exit(1);
+            }
+        }
  
     	// starting phase
     	avoidMap.clear();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/07a63a89/utils/src/com/cloud/utils/component/ComponentInstantiationPostProcessor.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/component/ComponentInstantiationPostProcessor.java b/utils/src/com/cloud/utils/component/ComponentInstantiationPostProcessor.java
index cb64975..256ff81 100644
--- a/utils/src/com/cloud/utils/component/ComponentInstantiationPostProcessor.java
+++ b/utils/src/com/cloud/utils/component/ComponentInstantiationPostProcessor.java
@@ -41,7 +41,7 @@ public class ComponentInstantiationPostProcessor implements InstantiationAwareBe
     private List<ComponentMethodInterceptor> _interceptors = new ArrayList<ComponentMethodInterceptor>();
     private Callback[] _callbacks;
     private CallbackFilter _callbackFilter;
-    
+
 	public ComponentInstantiationPostProcessor() {
 		_callbacks = new Callback[2];
 		_callbacks[0] = NoOp.INSTANCE;
@@ -49,23 +49,23 @@ public class ComponentInstantiationPostProcessor implements InstantiationAwareBe
 
 		_callbackFilter = new InterceptorFilter();
 	}
-	
+
 	public List<ComponentMethodInterceptor> getInterceptors() {
 		return _interceptors;
 	}
-	
+
 	public void setInterceptors(List<ComponentMethodInterceptor> interceptors) {
 		_interceptors = interceptors;
 	}
-	
+
 	private Callback[] getCallbacks() {
 		return _callbacks;
 	}
-	
+
 	private CallbackFilter getCallbackFilter() {
 		return _callbackFilter;
 	}
-	
+
 	@Override
 	public Object postProcessBeforeInitialization(Object bean, String beanName)
 			throws BeansException {
@@ -88,7 +88,7 @@ public class ComponentInstantiationPostProcessor implements InstantiationAwareBe
 		        enhancer.setCallbacks(getCallbacks());
 		        enhancer.setCallbackFilter(getCallbackFilter());
 		        enhancer.setNamingPolicy(ComponentNamingPolicy.INSTANCE);
-		        
+
 		        Object bean = enhancer.create();
 		        return bean;
 			}
@@ -108,12 +108,12 @@ public class ComponentInstantiationPostProcessor implements InstantiationAwareBe
 			throws BeansException {
 		return pvs;
 	}
-	
+
     protected class InterceptorDispatcher implements MethodInterceptor {
         @Override
         public Object intercept(Object target, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
             ArrayList<Pair<ComponentMethodInterceptor, Object>> interceptors = new ArrayList<Pair<ComponentMethodInterceptor, Object>>();
-            
+
             for (ComponentMethodInterceptor interceptor : getInterceptors()) {
                 if (interceptor.needToIntercept(method)) {
                     Object objReturnedInInterceptStart = interceptor.interceptStart(method, target);
@@ -136,14 +136,14 @@ public class ComponentInstantiationPostProcessor implements InstantiationAwareBe
             }
         }
     }
-    
+
     protected class InterceptorFilter implements CallbackFilter {
         @Override
         public int accept(Method method) {
             for(ComponentMethodInterceptor interceptor : getInterceptors()) {
-            
+
                 if (interceptor.needToIntercept(method)) {
-                	return 1;
+			return 1;
                 }
             }
             return 0;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/07a63a89/utils/src/com/cloud/utils/component/ComponentMethodInterceptor.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/component/ComponentMethodInterceptor.java b/utils/src/com/cloud/utils/component/ComponentMethodInterceptor.java
index 39a81d0..1925ddf 100644
--- a/utils/src/com/cloud/utils/component/ComponentMethodInterceptor.java
+++ b/utils/src/com/cloud/utils/component/ComponentMethodInterceptor.java
@@ -20,7 +20,7 @@ import java.lang.reflect.Method;
 
 public interface ComponentMethodInterceptor {
 	boolean needToIntercept(Method method);
-	
+
     Object interceptStart(Method method, Object target);
     void interceptComplete(Method method, Object target, Object objReturnedInInterceptStart);
     void interceptException(Method method, Object target, Object objReturnedInInterceptStart);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/07a63a89/utils/src/com/cloud/utils/component/ComponentNamingPolicy.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/component/ComponentNamingPolicy.java b/utils/src/com/cloud/utils/component/ComponentNamingPolicy.java
index 5659a48..03c1573 100644
--- a/utils/src/com/cloud/utils/component/ComponentNamingPolicy.java
+++ b/utils/src/com/cloud/utils/component/ComponentNamingPolicy.java
@@ -26,7 +26,7 @@ import net.sf.cglib.core.Predicate;
 public class ComponentNamingPolicy implements NamingPolicy {
 
 	public static final ComponentNamingPolicy INSTANCE = new ComponentNamingPolicy();
-    
+
     public String getClassName(String prefix, String source, Object key, Predicate names) {
         if (prefix == null) {
             prefix = "net.sf.cglib.empty.Object";
@@ -34,7 +34,7 @@ public class ComponentNamingPolicy implements NamingPolicy {
             prefix = "_" + prefix;
         }
         String base =
-            prefix + "_" + 
+            prefix + "_" +
             source.substring(source.lastIndexOf('.') + 1) +
             getTag() + "_" +
             Integer.toHexString(key.hashCode());
@@ -56,7 +56,7 @@ public class ComponentNamingPolicy implements NamingPolicy {
 	public int hashCode() {
 	    return getTag().hashCode();
 	}
-	
+
 	public boolean equals(Object o) {
 	    return (o instanceof ComponentNamingPolicy) && ((ComponentNamingPolicy) o).getTag().equals(getTag());
 	}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/07a63a89/utils/src/com/cloud/utils/db/GenericDaoBase.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/db/GenericDaoBase.java b/utils/src/com/cloud/utils/db/GenericDaoBase.java
index f0fc700..3c43666 100755
--- a/utils/src/com/cloud/utils/db/GenericDaoBase.java
+++ b/utils/src/com/cloud/utils/db/GenericDaoBase.java
@@ -201,7 +201,7 @@ public abstract class GenericDaoBase<T, ID extends Serializable> extends Compone
                 s_daoMaps.put(interphace, this);
             }
         }
-  
+
         _table = DbUtil.getTableName(_entityBeanType);
 
         final SqlGenerator generator = new SqlGenerator(_entityBeanType);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/07a63a89/utils/src/com/cloud/utils/db/TransactionContextBuilder.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/db/TransactionContextBuilder.java b/utils/src/com/cloud/utils/db/TransactionContextBuilder.java
index 40fcbbf..7bab62f 100644
--- a/utils/src/com/cloud/utils/db/TransactionContextBuilder.java
+++ b/utils/src/com/cloud/utils/db/TransactionContextBuilder.java
@@ -23,16 +23,16 @@ import com.cloud.utils.component.ComponentMethodInterceptor;
 public class TransactionContextBuilder implements ComponentMethodInterceptor {
 	public TransactionContextBuilder() {
 	}
-	
+
 	@Override
 	public boolean needToIntercept(Method method) {
         DB db = method.getAnnotation(DB.class);
         if (db != null) {
             return true;
         }
-        
+
         Class<?> clazz = method.getDeclaringClass();
-        
+
         do {
             db = clazz.getAnnotation(DB.class);
             if (db != null) {
@@ -46,20 +46,20 @@ public class TransactionContextBuilder implements ComponentMethodInterceptor {
 
 	@Override
     public Object interceptStart(Method method, Object target) {
-    	return Transaction.open(method.getName());
+	return Transaction.open(method.getName());
     }
-    
+
 	@Override
     public void interceptComplete(Method method, Object target, Object objReturnedInInterceptStart) {
-    	Transaction txn = (Transaction)objReturnedInInterceptStart;
-    	if(txn != null)
-    		txn.close();
+	Transaction txn = (Transaction)objReturnedInInterceptStart;
+	if(txn != null)
+		txn.close();
     }
-    
+
 	@Override
     public void interceptException(Method method, Object target, Object objReturnedInInterceptStart) {
-    	Transaction txn = (Transaction)objReturnedInInterceptStart;
-    	if(txn != null)
-    		txn.close();
+	Transaction txn = (Transaction)objReturnedInInterceptStart;
+	if(txn != null)
+		txn.close();
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/07a63a89/utils/test/resources/testContext.xml
----------------------------------------------------------------------
diff --git a/utils/test/resources/testContext.xml b/utils/test/resources/testContext.xml
index 5cccfcd..490288a 100644
--- a/utils/test/resources/testContext.xml
+++ b/utils/test/resources/testContext.xml
@@ -33,18 +33,18 @@
   <context:annotation-config />
 
   <context:component-scan base-package="org.apache.cloudstack, com.cloud" />
-
+
   <!--
     @DB support
   -->
   <bean id="transactionContextBuilder" class="com.cloud.utils.db.TransactionContextBuilder" />
 
-  <bean id="instantiatePostProcessor" class="com.cloud.utils.component.ComponentInstantiationPostProcessor">
-    <property name="Interceptors">
-        <list>
-            <ref bean="transactionContextBuilder" />
-        </list>
-    </property>
-  </bean>
+  <bean id="instantiatePostProcessor" class="com.cloud.utils.component.ComponentInstantiationPostProcessor">
+    <property name="Interceptors">
+        <list>
+            <ref bean="transactionContextBuilder" />
+        </list>
+    </property>
+  </bean>
 
 </beans>


[47/50] [abbrv] removing redundant entities

Posted by ts...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/SnapshotPolicy.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SnapshotPolicy.py b/tools/marvin/marvin/integration/lib/base/SnapshotPolicy.py
index a2e3497..d18c4ba 100644
--- a/tools/marvin/marvin/integration/lib/base/SnapshotPolicy.py
+++ b/tools/marvin/marvin/integration/lib/base/SnapshotPolicy.py
@@ -16,6 +16,8 @@
 # under the License.
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import createSnapshotPolicy
+from marvin.cloudstackAPI import listSnapshotPolicies
+from marvin.cloudstackAPI import deleteSnapshotPolicies
 
 class SnapshotPolicy(CloudStackEntity.CloudStackEntity):
 
@@ -32,3 +34,19 @@ class SnapshotPolicy(CloudStackEntity.CloudStackEntity):
         snapshotpolicy = apiclient.createSnapshotPolicy(cmd)
         return SnapshotPolicy(snapshotpolicy.__dict__)
 
+
+    @classmethod
+    def list(self, apiclient, volumeid, **kwargs):
+        cmd = listSnapshotPolicies.listSnapshotPoliciesCmd()
+        cmd.volumeid = volumeid
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        snapshotpolicies = apiclient.listSnapshotPolicies(cmd)
+        return map(lambda e: SnapshotPolicy(e.__dict__), snapshotpolicies)
+
+
+    def delete(self, apiclient, **kwargs):
+        cmd = deleteSnapshotPolicies.deleteSnapshotPoliciesCmd()
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        snapshotpolicies = apiclient.deleteSnapshotPolicies(cmd)
+        return snapshotpolicies

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/StorageMaintenance.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/StorageMaintenance.py b/tools/marvin/marvin/integration/lib/base/StorageMaintenance.py
deleted file mode 100644
index 09ed406..0000000
--- a/tools/marvin/marvin/integration/lib/base/StorageMaintenance.py
+++ /dev/null
@@ -1,44 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import cancelStorageMaintenance
-from marvin.cloudstackAPI import enableStorageMaintenance
-
-class StorageMaintenance(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def cancel(self, apiclient, id, **kwargs):
-        cmd = cancelStorageMaintenance.cancelStorageMaintenanceCmd()
-        cmd.id = self.id
-        cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        storagemaintenance = apiclient.cancelStorageMaintenance(cmd)
-        return storagemaintenance
-
-
-    def enable(self, apiclient, id, **kwargs):
-        cmd = enableStorageMaintenance.enableStorageMaintenanceCmd()
-        cmd.id = self.id
-        cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        storagemaintenance = apiclient.enableStorageMaintenance(cmd)
-        return storagemaintenance
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/StoragePool.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/StoragePool.py b/tools/marvin/marvin/integration/lib/base/StoragePool.py
index 91fd261..dfda35a 100644
--- a/tools/marvin/marvin/integration/lib/base/StoragePool.py
+++ b/tools/marvin/marvin/integration/lib/base/StoragePool.py
@@ -19,6 +19,8 @@ from marvin.cloudstackAPI import createStoragePool
 from marvin.cloudstackAPI import listStoragePools
 from marvin.cloudstackAPI import updateStoragePool
 from marvin.cloudstackAPI import deleteStoragePool
+from marvin.cloudstackAPI import cancelStorageMaintenance
+from marvin.cloudstackAPI import enableStorageMaintenance
 
 class StoragePool(CloudStackEntity.CloudStackEntity):
 
@@ -61,3 +63,19 @@ class StoragePool(CloudStackEntity.CloudStackEntity):
         storagepool = apiclient.deleteStoragePool(cmd)
         return storagepool
 
+
+    def cancel_maintenance(self, apiclient, **kwargs):
+        cmd = cancelStorageMaintenance.cancelStorageMaintenanceCmd()
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        storagemaintenance = apiclient.cancelStorageMaintenance(cmd)
+        return storagemaintenance
+
+
+    def enable_maintenance(self, apiclient, **kwargs):
+        cmd = enableStorageMaintenance.enableStorageMaintenanceCmd()
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        storagemaintenance = apiclient.enableStorageMaintenance(cmd)
+        return storagemaintenance
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/ToGlobalLoadBalancerRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ToGlobalLoadBalancerRule.py b/tools/marvin/marvin/integration/lib/base/ToGlobalLoadBalancerRule.py
deleted file mode 100644
index e5a2ede..0000000
--- a/tools/marvin/marvin/integration/lib/base/ToGlobalLoadBalancerRule.py
+++ /dev/null
@@ -1,34 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import assignToGlobalLoadBalancerRule
-
-class ToGlobalLoadBalancerRule(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def assign(self, apiclient, loadbalancerrulelist, id, **kwargs):
-        cmd = assignToGlobalLoadBalancerRule.assignToGlobalLoadBalancerRuleCmd()
-        cmd.id = self.id
-        cmd.id = id
-        cmd.loadbalancerrulelist = loadbalancerrulelist
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        togloballoadbalancerrule = apiclient.assignToGlobalLoadBalancerRule(cmd)
-        return togloballoadbalancerrule

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py b/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py
deleted file mode 100644
index 552c9ac..0000000
--- a/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py
+++ /dev/null
@@ -1,35 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import assignToLoadBalancerRule
-
-class ToLoadBalancerRule(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def assign(self, apiclient, id, virtualmachineids, **kwargs):
-        cmd = assignToLoadBalancerRule.assignToLoadBalancerRuleCmd()
-        cmd.id = self.id
-        cmd.id = id
-        cmd.virtualmachineids = virtualmachineids
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        toloadbalancerrule = apiclient.assignToLoadBalancerRule(cmd)
-        return toloadbalancerrule
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/User.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/User.py b/tools/marvin/marvin/integration/lib/base/User.py
index c0bad62..a7c2262 100644
--- a/tools/marvin/marvin/integration/lib/base/User.py
+++ b/tools/marvin/marvin/integration/lib/base/User.py
@@ -23,6 +23,7 @@ from marvin.cloudstackAPI import listUsers
 from marvin.cloudstackAPI import updateUser
 from marvin.cloudstackAPI import disableUser
 from marvin.cloudstackAPI import deleteUser
+from marvin.cloudstackAPI import registerUserKeys
 
 class User(CloudStackEntity.CloudStackEntity):
 
@@ -101,3 +102,11 @@ class User(CloudStackEntity.CloudStackEntity):
         user = apiclient.deleteUser(cmd)
         return user
 
+
+    def register_userkeys(self, apiclient, **kwargs):
+        cmd = registerUserKeys.registerUserKeysCmd()
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        userkeys = apiclient.registerUserKeys(cmd)
+        return userkeys
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/UserKeys.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/UserKeys.py b/tools/marvin/marvin/integration/lib/base/UserKeys.py
deleted file mode 100644
index a42b65b..0000000
--- a/tools/marvin/marvin/integration/lib/base/UserKeys.py
+++ /dev/null
@@ -1,34 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import registerUserKeys
-
-class UserKeys(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def register(self, apiclient, id, **kwargs):
-        cmd = registerUserKeys.registerUserKeysCmd()
-        cmd.id = self.id
-        cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        userkeys = apiclient.registerUserKeys(cmd)
-        return userkeys
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/VirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VirtualMachine.py b/tools/marvin/marvin/integration/lib/base/VirtualMachine.py
index 4a08454..0d2fd44 100644
--- a/tools/marvin/marvin/integration/lib/base/VirtualMachine.py
+++ b/tools/marvin/marvin/integration/lib/base/VirtualMachine.py
@@ -26,6 +26,11 @@ from marvin.cloudstackAPI import updateVirtualMachine
 from marvin.cloudstackAPI import startVirtualMachine
 from marvin.cloudstackAPI import destroyVirtualMachine
 from marvin.cloudstackAPI import assignVirtualMachine
+from marvin.cloudstackAPI import addNicToVirtualMachine
+from marvin.cloudstackAPI import removeNicFromVirtualMachine
+from marvin.cloudstackAPI import resetPasswordForVirtualMachine
+from marvin.cloudstackAPI import resetSSHKeyForVirtualMachine
+from marvin.cloudstackAPI import updateDefaultNicForVirtualMachine
 
 class VirtualMachine(CloudStackEntity.CloudStackEntity):
 
@@ -43,10 +48,9 @@ class VirtualMachine(CloudStackEntity.CloudStackEntity):
         return virtualmachine
 
 
-    def scale(self, apiclient, id, serviceofferingid, **kwargs):
+    def scale(self, apiclient, serviceofferingid, **kwargs):
         cmd = scaleVirtualMachine.scaleVirtualMachineCmd()
         cmd.id = self.id
-        cmd.id = id
         cmd.serviceofferingid = serviceofferingid
         [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         virtualmachine = apiclient.scaleVirtualMachine(cmd)
@@ -79,46 +83,41 @@ class VirtualMachine(CloudStackEntity.CloudStackEntity):
         return map(lambda e: VirtualMachine(e.__dict__), virtualmachine)
 
 
-    def stop(self, apiclient, id, **kwargs):
+    def stop(self, apiclient, **kwargs):
         cmd = stopVirtualMachine.stopVirtualMachineCmd()
         cmd.id = self.id
-        cmd.id = id
         [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         virtualmachine = apiclient.stopVirtualMachine(cmd)
         return virtualmachine
 
 
-    def reboot(self, apiclient, id, **kwargs):
+    def reboot(self, apiclient, **kwargs):
         cmd = rebootVirtualMachine.rebootVirtualMachineCmd()
         cmd.id = self.id
-        cmd.id = id
         [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         virtualmachine = apiclient.rebootVirtualMachine(cmd)
         return virtualmachine
 
 
-    def update(self, apiclient, id, **kwargs):
+    def update(self, apiclient, **kwargs):
         cmd = updateVirtualMachine.updateVirtualMachineCmd()
         cmd.id = self.id
-        cmd.id = id
         [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         virtualmachine = apiclient.updateVirtualMachine(cmd)
         return virtualmachine
 
 
-    def start(self, apiclient, id, **kwargs):
+    def start(self, apiclient, **kwargs):
         cmd = startVirtualMachine.startVirtualMachineCmd()
         cmd.id = self.id
-        cmd.id = id
         [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         virtualmachine = apiclient.startVirtualMachine(cmd)
         return virtualmachine
 
 
-    def destroy(self, apiclient, id, **kwargs):
+    def destroy(self, apiclient, **kwargs):
         cmd = destroyVirtualMachine.destroyVirtualMachineCmd()
         cmd.id = self.id
-        cmd.id = id
         [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         virtualmachine = apiclient.destroyVirtualMachine(cmd)
         return virtualmachine
@@ -134,3 +133,46 @@ class VirtualMachine(CloudStackEntity.CloudStackEntity):
         virtualmachine = apiclient.assignVirtualMachine(cmd)
         return virtualmachine
 
+    def remove_nic(self, apiclient, nicid, **kwargs):
+        cmd = removeNicFromVirtualMachine.removeNicFromVirtualMachineCmd()
+        cmd.virtualmachineid = self.id
+        cmd.nicid = nicid
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        nicfromvirtualmachine = apiclient.removeNicFromVirtualMachine(cmd)
+        return nicfromvirtualmachine
+
+
+    def add_nic(self, apiclient, networkid, **kwargs):
+        cmd = addNicToVirtualMachine.addNicToVirtualMachineCmd()
+        cmd.virtualmachineid = self.id
+        cmd.networkid = networkid
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        nictovirtualmachine = apiclient.addNicToVirtualMachine(cmd)
+        return nictovirtualmachine
+
+
+    def update_default_nic(self, apiclient, nicid, **kwargs):
+        cmd = updateDefaultNicForVirtualMachine.updateDefaultNicForVirtualMachineCmd()
+        cmd.virtualmachineid = self.id
+        cmd.nicid = nicid
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        defaultnicforvirtualmachine = apiclient.updateDefaultNicForVirtualMachine(cmd)
+        return defaultnicforvirtualmachine
+
+
+    def reset_password(self, apiclient, **kwargs):
+        cmd = resetPasswordForVirtualMachine.resetPasswordForVirtualMachineCmd()
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        passwordforvirtualmachine = apiclient.resetPasswordForVirtualMachine(cmd)
+        return passwordforvirtualmachine
+
+
+    def reset_sshkey(self, apiclient, keypair, **kwargs):
+        cmd = resetSSHKeyForVirtualMachine.resetSSHKeyForVirtualMachineCmd()
+        cmd.id = self.id
+        cmd.keypair = keypair
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        sshkeyforvirtualmachine = apiclient.resetSSHKeyForVirtualMachine(cmd)
+        return sshkeyforvirtualmachine
+


[38/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
Fixes from conflicts during rebase

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


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

Branch: refs/heads/marvin_refactor
Commit: ed291eed4fd4f0f7e0e2472bec086dcdd1623d35
Parents: dfc703f
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Sat Mar 30 19:36:58 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:19:28 2013 +0530

----------------------------------------------------------------------
 .../command/user/template/DeleteTemplateCmd.java   |    9 +-
 .../command/user/template/ExtractTemplateCmd.java  |    9 +-
 client/pom.xml                                     |   10 +
 client/tomcatconf/componentContext.xml.in          |  149 ++------------
 server/src/com/cloud/api/ApiDispatcher.java        |   12 +-
 .../src/com/cloud/api/query/QueryManagerImpl.java  |    6 +-
 tools/cli/cloudmonkey/cloudmonkey.py               |   38 +----
 7 files changed, 57 insertions(+), 176 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ed291eed/api/src/org/apache/cloudstack/api/command/user/template/DeleteTemplateCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/DeleteTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/DeleteTemplateCmd.java
index 12359bf..77f7edf 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/DeleteTemplateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/DeleteTemplateCmd.java
@@ -16,7 +16,13 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.template;
 
-import org.apache.cloudstack.api.*;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.SuccessResponse;
 import org.apache.cloudstack.api.response.TemplateResponse;
 import org.apache.cloudstack.api.response.ZoneResponse;
 import org.apache.log4j.Logger;
@@ -29,6 +35,7 @@ import com.cloud.template.VirtualMachineTemplate;
 import com.cloud.user.Account;
 import com.cloud.user.UserContext;
 
+
 @APICommand(name = "deleteTemplate", responseObject=SuccessResponse.class, description="Deletes a template from the system. All virtual machines using the deleted template will not be affected.")
 public class DeleteTemplateCmd extends BaseAsyncCmd {
     public static final Logger s_logger = Logger.getLogger(DeleteTemplateCmd.class.getName());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ed291eed/api/src/org/apache/cloudstack/api/command/user/template/ExtractTemplateCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/ExtractTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/ExtractTemplateCmd.java
index 8b4e809..6afb993 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/ExtractTemplateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/ExtractTemplateCmd.java
@@ -16,7 +16,13 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.template;
 
-import org.apache.cloudstack.api.*;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.ExtractResponse;
 import org.apache.cloudstack.api.response.TemplateResponse;
 import org.apache.cloudstack.api.response.ZoneResponse;
 import org.apache.log4j.Logger;
@@ -30,6 +36,7 @@ import com.cloud.template.VirtualMachineTemplate;
 import com.cloud.user.Account;
 import com.cloud.user.UserContext;
 
+
 @APICommand(name = "extractTemplate", description="Extracts a template", responseObject=ExtractResponse.class)
 public class ExtractTemplateCmd extends BaseAsyncCmd {
     public static final Logger s_logger = Logger.getLogger(ExtractTemplateCmd.class.getName());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ed291eed/client/pom.xml
----------------------------------------------------------------------
diff --git a/client/pom.xml b/client/pom.xml
index 7565029..9236deb 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -219,6 +219,16 @@
       <artifactId>cloud-plugin-hypervisor-simulator</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-plugin-hypervisor-ucs</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.cloudstack</groupId>
+        <artifactId>cloud-plugin-storage-volume-default</artifactId>
+        <version>${project.version}</version>
+    </dependency>
   </dependencies>
   <build>
     <defaultGoal>install</defaultGoal>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ed291eed/client/tomcatconf/componentContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/componentContext.xml.in b/client/tomcatconf/componentContext.xml.in
index 43fc9aa..594c683 100644
--- a/client/tomcatconf/componentContext.xml.in
+++ b/client/tomcatconf/componentContext.xml.in
@@ -53,132 +53,29 @@
     </property>
   </bean>
 
-<!--
-  <bean id="BigSwitchVnsElementService" class="com.cloud.network.element.BigSwitchVnsElement">
-    <property name="name" value="BigSwitchVnsElementService"/>
-  </bean>
--->
-
-  <!--
-     Adapters
-  -->
-  <bean id="FirstFitRouting" class="com.cloud.agent.manager.allocator.impl.FirstFitRoutingAllocator">
-    <property name="name" value="FirstFitRouting"/>
-  </bean>
-
-  <bean id="hypervisorTemplateAdapter" class="com.cloud.template.HypervisorTemplateAdapter">
-    <property name="name" value="HypervisorAdapter"/>
-  </bean>
-
-   <bean id="bareMetalTemplateAdapter" class="com.cloud.baremetal.BareMetalTemplateAdapter">
-    <property name="name" value="BareMetalAdapter"/>
-  </bean>
-
-  <!--
-    Storage pool allocators
-  -->
-
-  <bean id="LocalStoragePoolAllocator" class="org.apache.cloudstack.storage.allocator.LocalStoragePoolAllocator">
-    <property name="name" value="LocalStorage"/>
-  </bean>
-  <!--
-  <bean id="FirstFitStoragePoolAllocator" class="org.apache.cloudstack.storage.allocator.FirstFitStoragePoolAllocator">
-    <property name="name" value="Storage"/>
-  </bean>
-  -->
-
-  <bean id="UserConcentratedAllocator" class="com.cloud.agent.manager.allocator.impl.UserConcentratedAllocator">
-    <property name="name" value="User First"/>
-  </bean>
-
-  <bean id="ConsoleProxyAllocator" class="com.cloud.consoleproxy.ConsoleProxyBalanceAllocator">
-    <property name="name" value="Balance"/>
-  </bean>
-
-  <bean id="StaticRoleBasedAPIAccessChecker" class="org.apache.cloudstack.acl.StaticRoleBasedAPIAccessChecker"/>
-
-  <bean id="ExteralIpAddressAllocator" class="com.cloud.network.ExteralIpAddressAllocator">
-    <property name="name" value="Basic"/>
-  </bean>
-
-  <bean id="HypervisorTemplateAdapter" class="com.cloud.template.HypervisorTemplateAdapter">
-    <property name="name" value="HypervisorAdapter"/>
-  </bean>
-
-  <bean id="BareMetalTemplateAdapter" class="com.cloud.baremetal.manager.BareMetalTemplateAdapter" >
-    <property name="name" value="BareMetalTemplateAdapter"/>
-  </bean>
-
-  <!--
-    Authenticators
-  -->
-  <bean id="MD5UserAuthenticator" class="com.cloud.server.auth.MD5UserAuthenticator">
-    <property name="name" value="MD5"/>
-  </bean>
-
-  <bean id="LDAPUserAuthenticator" class="com.cloud.server.auth.LDAPUserAuthenticator">
-    <property name="name" value="LDAP"/>
-  </bean>
-
-  <!--
-    Investigators
-  -->
-  <bean id="CheckOnAgentInvestigator" class="com.cloud.ha.CheckOnAgentInvestigator">
-    <property name="name" value="SimpleInvestigator"/>
-  </bean>
-
-  <bean id="XenServerInvestigator" class="com.cloud.ha.XenServerInvestigator">
-    <property name="name" value="XenServerInvestigator"/>
-  </bean>
-
-  <bean id="UserVmDomRInvestigator" class="com.cloud.ha.UserVmDomRInvestigator">
-    <property name="name" value="PingInvestigator"/>
-  </bean>
-
-  <bean id="ManagementIPSystemVMInvestigator" class="com.cloud.ha.ManagementIPSystemVMInvestigator">
-    <property name="name" value="ManagementIPSysVMInvestigator"/>
-  </bean>
-
-  <!--
-    Fencers
-  -->
-  <bean id="XenServerFencer" class="com.cloud.ha.XenServerFencer">
-    <property name="name" value="XenServerFenceBuilder"/>
-  </bean>
-  <bean id="KVMFencer" class="com.cloud.ha.KVMFencer">
-    <property name="name" value="KVMFenceBuilder"/>
-  </bean>
-  <bean id="OvmFencer" class="com.cloud.ovm.hypervisor.OvmFencer">
-    <property name="name" value="OvmFenceBuilder"/>
-  </bean>
-
-  <bean id="XcpServerDiscoverer" class="com.cloud.hypervisor.xen.discoverer.XcpServerDiscoverer">
-    <property name="name" value="XCP Agent"/>
-  </bean>
-
-  <bean id="SecondaryStorageDiscoverer" class="com.cloud.storage.secondary.SecondaryStorageDiscoverer">
-    <property name="name" value="SecondaryStorage"/>
-  </bean>
-
-  <bean id="KvmServerDiscoverer" class="com.cloud.hypervisor.kvm.discoverer.KvmServerDiscoverer">
-    <property name="name" value="KVM Agent"/>
-  </bean>
-
-  <bean id="SimulatorDiscoverer" class="com.cloud.resource.SimulatorDiscoverer">
-    <property name="name" value="Simulator Agent"/>
-  </bean>
-
-
-  <bean id="BareMetalDiscoverer" class="com.cloud.baremetal.manager.BareMetalDiscoverer">
-    <property name="name" value="Bare Metal Agent"/>
-  </bean>
-
-  <bean id="HypervServerDiscoverer" class="com.cloud.hypervisor.hyperv.HypervServerDiscoverer">
-    <property name="name" value="SCVMMServer"/>
+  <bean id="managementServerImpl" class ="com.cloud.server.ManagementServerImpl">
+    <property name="UserAuthenticators">
+      <list>
+          <ref bean="MD5UserAuthenticator"/>
+          <ref bean="LDAPUserAuthenticator"/>
+      </list>
+    </property>
+    <property name="HostAllocators">
+      <list>
+          <ref bean="FirstFitRouting"/>
+      </list>
+    </property>
   </bean>
 
-  <bean id="OvmDiscoverer" class="com.cloud.ovm.hypervisor.OvmDiscoverer">
-    <property name="name" value="Ovm Discover"/>
+  <bean id="storageManagerImpl" class="com.cloud.storage.StorageManagerImpl">
+    <property name="StoragePoolAllocators">
+      <list>
+          <ref bean="LocalStoragePoolAllocator"/>
+          <ref bean="clusterScopeStoragePoolAllocator"/>
+          <ref bean="zoneWideStoragePoolAllocator"/>
+          <ref bean="garbageCollectingStoragePoolAllocator"/>
+      </list>
+    </property>
   </bean>
 
   <bean id="FirstFitPlanner" class="com.cloud.deploy.FirstFitPlanner">
@@ -318,8 +215,6 @@
     </property>
   </bean>
 
-  <bean id="SimulatorGuru" class="com.cloud.simulator.SimulatorGuru">
-    <property name="name" value="SimulatorGuru"/>
-  </bean>
+  <bean id="GlobalLoadBalancingRulesServiceImpl" class ="org.apache.cloudstack.region.gslb.GlobalLoadBalancingRulesServiceImpl" />
 
 </beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ed291eed/server/src/com/cloud/api/ApiDispatcher.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiDispatcher.java b/server/src/com/cloud/api/ApiDispatcher.java
index cfcccc5..925d90a 100755
--- a/server/src/com/cloud/api/ApiDispatcher.java
+++ b/server/src/com/cloud/api/ApiDispatcher.java
@@ -153,10 +153,11 @@ public class ApiDispatcher {
                         queueSizeLimit = 1L;
                     }
 
-                if (queueSizeLimit != null) {
+                    if (queueSizeLimit != null) {
                     _asyncMgr.syncAsyncJobExecution(asyncCmd.getJob(), asyncCmd.getSyncObjType(), asyncCmd.getSyncObjId().longValue(), queueSizeLimit);
-                } else {
-                    s_logger.trace("The queue size is unlimited, skipping the synchronizing");
+                    } else {
+                        s_logger.trace("The queue size is unlimited, skipping the synchronizing");
+                    }
                 }
             }
 
@@ -370,13 +371,8 @@ public class ApiDispatcher {
         if (internalId == null) {
             if (s_logger.isDebugEnabled())
                 s_logger.debug("Object entity uuid = " + uuid + " does not exist in the database.");
-<<<<<<< HEAD
             throw new InvalidParameterValueException("Invalid parameter " + annotation.name() + " value=" + uuid
                 + " due to incorrect long value format, or entity does not exist or due to incorrect parameter annotation for the field in api cmd class.");
-=======
-            throw new InvalidParameterValueException("Invalid parameter value=" + uuid
-                + " due to incorrect long value format, or entity was not found as it may have been deleted, or due to incorrect parameter annotation for the field in api cmd.");
->>>>>>> ApiDispatcher: Fix uuid->id translation and throw better debug statement
         }
         return internalId;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ed291eed/server/src/com/cloud/api/query/QueryManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java
index 63c6b32..951d09e 100644
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@ -2105,7 +2105,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
                 domainRecord = _domainDao.findById(domainRecord.getParent());
                 domainIds.add(domainRecord.getId());
             }
-            sc.addAnd("domainId", SearchCriteria.Op.IN, domainIds);
+            sc.addAnd("domainId", SearchCriteria.Op.IN, domainIds.toArray());
 
             // include also public offering if no keyword, name and id specified
             if ( keyword == null && name == null && id == null ){
@@ -2238,7 +2238,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
                 }
                 // domainId == null (public zones) or domainId IN [all domain id up to root domain]
                 SearchCriteria<DataCenterJoinVO> sdc = _dcJoinDao.createSearchCriteria();
-                sdc.addOr("domainId", SearchCriteria.Op.IN, domainIds);
+                sdc.addOr("domainId", SearchCriteria.Op.IN, domainIds.toArray());
                 sdc.addOr("domainId", SearchCriteria.Op.NULL);
                 sc.addAnd("domain", SearchCriteria.Op.SC, sdc);
 
@@ -2268,7 +2268,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
 
                 // domainId == null (public zones) or domainId IN [all domain id up to root domain]
                 SearchCriteria<DataCenterJoinVO> sdc = _dcJoinDao.createSearchCriteria();
-                sdc.addOr("domainId", SearchCriteria.Op.IN, domainIds);
+                sdc.addOr("domainId", SearchCriteria.Op.IN, domainIds.toArray());
                 sdc.addOr("domainId", SearchCriteria.Op.NULL);
                 sc.addAnd("domain", SearchCriteria.Op.SC, sdc);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ed291eed/tools/cli/cloudmonkey/cloudmonkey.py
----------------------------------------------------------------------
diff --git a/tools/cli/cloudmonkey/cloudmonkey.py b/tools/cli/cloudmonkey/cloudmonkey.py
index d679e50..664bb03 100644
--- a/tools/cli/cloudmonkey/cloudmonkey.py
+++ b/tools/cli/cloudmonkey/cloudmonkey.py
@@ -261,42 +261,8 @@ class CloudMonkeyShell(cmd.Cmd, object):
         if response is None:
             return
 
-        isAsync = isAsync and (self.asyncblock == "true")
-        responsekey = filter(lambda x: 'response' in x, response.keys())[0]
-        if isAsync and 'jobid' in response[responsekey]:
-            jobId = response[responsekey]['jobid']
-            command = "queryAsyncJobResult"
-            requests = {'jobid': jobId}
-            timeout = int(self.timeout)
-            pollperiod = 3
-            progress = 1
-            while timeout > 0:
-                print '\r' + '.' * progress,
-                sys.stdout.flush()
-                response = process_json(conn.make_request_with_auth(command,
-                                                                    requests))
-                responsekeys = filter(lambda x: 'response' in x,
-                                      response.keys())
-                if len(responsekeys) < 1:
-                    continue
-                result = response[responsekeys[0]]
-                jobstatus = result['jobstatus']
-                if jobstatus == 2:
-                    jobresult = result["jobresult"]
-                    self.print_shell("\rAsync query failed for jobid",
-                                     jobId, "\nError", jobresult["errorcode"],
-                                     jobresult["errortext"])
-                    return
-                elif jobstatus == 1:
-                    print '\r',
-                    return response
-                time.sleep(pollperiod)
-                timeout = timeout - pollperiod
-                progress += 1
-                logger.debug("job: %s to timeout in %ds" % (jobId, timeout))
-            self.print_shell("Error:", "Async query timeout for jobid", jobId)
-
-        return response
+        apiname = args.partition(' ')[0]
+        verb, subject = splitverbsubject(apiname)
 
     def get_api_module(self, api_name, api_class_strs=[]):
         try:


[24/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
CLOUDSTACK-240: added id/uuid fields to remote_access_vpn table and corresponding VO/Dao objects. The DB upgrade is covered as well. Now tags can be created for the VPN object


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

Branch: refs/heads/marvin_refactor
Commit: 8821bfb7cfe7107cbd738d793222a9d1edcf45cc
Parents: b7b8fdc
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Fri Mar 29 10:36:55 2013 -0700
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:06:28 2013 +0530

----------------------------------------------------------------------
 .../api/response/RemoteAccessVpnResponse.java      |    7 +++
 .../com/cloud/network/dao/RemoteAccessVpnVO.java   |    6 +-
 .../router/VirtualNetworkApplianceManagerImpl.java |    4 +-
 .../network/vpn/RemoteAccessVpnManagerImpl.java    |    6 +-
 .../src/com/cloud/upgrade/dao/Upgrade410to420.java |   41 +++++++++++++-
 setup/db/db/schema-410to420-cleanup.sql            |    2 -
 6 files changed, 52 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8821bfb7/api/src/org/apache/cloudstack/api/response/RemoteAccessVpnResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/RemoteAccessVpnResponse.java b/api/src/org/apache/cloudstack/api/response/RemoteAccessVpnResponse.java
index 5e08bca..e8d7eb4 100644
--- a/api/src/org/apache/cloudstack/api/response/RemoteAccessVpnResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/RemoteAccessVpnResponse.java
@@ -61,6 +61,9 @@ public class RemoteAccessVpnResponse extends BaseResponse implements ControlledE
     @SerializedName(ApiConstants.ID) @Param(description="the id of the remote access vpn")
     private String id;
 
+    @SerializedName(ApiConstants.ID) @Param(description="the id of the remote access vpn")
+    private String id;
+
     public void setPublicIp(String publicIp) {
         this.publicIp = publicIp;
     }
@@ -108,4 +111,8 @@ public class RemoteAccessVpnResponse extends BaseResponse implements ControlledE
         this.id = id;
     }
 
+    public void setId(String id) {
+        this.id = id;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8821bfb7/server/src/com/cloud/network/dao/RemoteAccessVpnVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/RemoteAccessVpnVO.java b/server/src/com/cloud/network/dao/RemoteAccessVpnVO.java
index 2e8ee91..a518ba1 100644
--- a/server/src/com/cloud/network/dao/RemoteAccessVpnVO.java
+++ b/server/src/com/cloud/network/dao/RemoteAccessVpnVO.java
@@ -53,16 +53,16 @@ public class RemoteAccessVpnVO implements RemoteAccessVpn {
     
     @Column(name="state")
     private State state;
-    
+
     @Id
     @GeneratedValue(strategy=GenerationType.IDENTITY)
     @Column(name="id")
     private long id;
-    
+
     @Column(name="uuid")
     private String uuid;
 
-    public RemoteAccessVpnVO() { 
+    public RemoteAccessVpnVO() {
         this.uuid = UUID.randomUUID().toString();
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8821bfb7/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index 50188e7..d551d37 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -303,8 +303,6 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
     @Inject
     VpnUserDao _vpnUsersDao;
     @Inject
-    RemoteAccessVpnDao _remoteAccessVpnDao;
-    @Inject
     RulesManager _rulesMgr;
     @Inject
     NetworkDao _networkDao;
@@ -2337,7 +2335,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
                 }
       
                 if (_networkModel.isProviderSupportServiceInNetwork(guestNetworkId, Service.Vpn, provider)) {
-                    RemoteAccessVpn vpn = _vpnDao.findById(ip.getId());
+                    RemoteAccessVpn vpn = _vpnDao.findByPublicIpAddress(ip.getId());
                     if (vpn != null) {
                         vpns.add(vpn);
                     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8821bfb7/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java b/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java
index 673535a..4b4a04b 100755
--- a/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java
+++ b/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java
@@ -184,15 +184,15 @@ public class RemoteAccessVpnManagerImpl extends ManagerBase implements RemoteAcc
         long startIp = NetUtils.ip2Long(range[0]);
         String newIpRange = NetUtils.long2Ip(++startIp) + "-" + range[1];
         String sharedSecret = PasswordGenerator.generatePresharedKey(_pskLength);
-        
+
         Transaction txn = Transaction.currentTxn();
         txn.start();
-        
+
         _rulesMgr.reservePorts(ipAddr, NetUtils.UDP_PROTO, Purpose.Vpn, openFirewall, caller, NetUtils.VPN_PORT, NetUtils.VPN_L2TP_PORT, NetUtils.VPN_NATT_PORT);
         vpnVO = new RemoteAccessVpnVO(ipAddr.getAccountId(), ipAddr.getDomainId(), ipAddr.getAssociatedWithNetworkId(),
                 publicIpId, range[0], newIpRange, sharedSecret);
         RemoteAccessVpn vpn = _remoteAccessVpnDao.persist(vpnVO);
-        
+
         txn.commit();
         return vpn;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8821bfb7/server/src/com/cloud/upgrade/dao/Upgrade410to420.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/upgrade/dao/Upgrade410to420.java b/server/src/com/cloud/upgrade/dao/Upgrade410to420.java
index dd0aa3e..5144ab6 100644
--- a/server/src/com/cloud/upgrade/dao/Upgrade410to420.java
+++ b/server/src/com/cloud/upgrade/dao/Upgrade410to420.java
@@ -17,9 +17,6 @@
 
 package com.cloud.upgrade.dao;
 
-import com.cloud.utils.exception.CloudRuntimeException;
-import com.cloud.utils.script.Script;
-
 import java.io.File;
 import java.sql.Connection;
 import java.sql.PreparedStatement;
@@ -29,6 +26,9 @@ import java.util.UUID;
 
 import org.apache.log4j.Logger;
 
+import com.cloud.utils.exception.CloudRuntimeException;
+import com.cloud.utils.script.Script;
+
 public class Upgrade410to420 implements DbUpgrade {
 	final static Logger s_logger = Logger.getLogger(Upgrade410to420.class);
 
@@ -61,6 +61,7 @@ public class Upgrade410to420 implements DbUpgrade {
 	public void performDataMigration(Connection conn) {
         upgradeVmwareLabels(conn);
         createPlaceHolderNics(conn);
+        updateRemoteAccessVpn(conn);
         PreparedStatement sql = null;
         try {
             sql = conn.prepareStatement("update vm_template set image_data_store_id = 1 where type = 'SYSTEM' or type = 'BUILTIN'");
@@ -196,4 +197,38 @@ public class Upgrade410to420 implements DbUpgrade {
             }
         }
     }
+
+
+    private void updateRemoteAccessVpn(Connection conn) {
+        PreparedStatement pstmt = null;
+        ResultSet rs = null;
+
+        try {
+            pstmt = conn.prepareStatement("SELECT vpn_server_addr_id FROM `cloud`.`remote_access_vpn`");
+            rs = pstmt.executeQuery();
+            long id=1;
+            while (rs.next()) {
+                    String uuid = UUID.randomUUID().toString();
+                    Long ipId = rs.getLong(1);
+                    pstmt = conn.prepareStatement("UPDATE `cloud`.`remote_access_vpn` set uuid=?, id=? where vpn_server_addr_id=?");
+                    pstmt.setString(1, uuid);
+                    pstmt.setLong(2, id);
+                    pstmt.setLong(3, ipId);
+                    pstmt.executeUpdate();
+                    id++;
+            }
+        } catch (SQLException e) {
+            throw new CloudRuntimeException("Unable to update id/uuid of remote_access_vpn table", e);
+        } finally {
+            try {
+                if (rs != null) {
+                    rs.close();
+                }
+                if (pstmt != null) {
+                    pstmt.close();
+                }
+            } catch (SQLException e) {
+            }
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8821bfb7/setup/db/db/schema-410to420-cleanup.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420-cleanup.sql b/setup/db/db/schema-410to420-cleanup.sql
index 187076f..d3d5ca3 100644
--- a/setup/db/db/schema-410to420-cleanup.sql
+++ b/setup/db/db/schema-410to420-cleanup.sql
@@ -24,5 +24,3 @@ ALTER TABLE remote_access_vpn DROP foreign key `fk_remote_access_vpn__vpn_server
 ALTER TABLE remote_access_vpn DROP primary key;
 ALTER TABLE remote_access_vpn ADD primary key (`id`);
 ALTER TABLE remote_access_vpn ADD CONSTRAINT `fk_remote_access_vpn__vpn_server_addr_id` FOREIGN KEY (`vpn_server_addr_id`) REFERENCES `user_ip_address` (`id`);
-
-


[09/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
CLOUDSTACK-1608: enable attach a volume created on zone wide storage to a vm created on cluster or host wide storage


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

Branch: refs/heads/marvin_refactor
Commit: 7d4fd16691a144bf1adce4c40ca2145a7f1f7048
Parents: 8b15988
Author: Edison Su <su...@gmail.com>
Authored: Tue Mar 19 14:45:17 2013 -0700
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:01:24 2013 +0530

----------------------------------------------------------------------
 .../src/com/cloud/storage/VolumeManagerImpl.java   |  107 ++++-----------
 1 files changed, 28 insertions(+), 79 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7d4fd166/server/src/com/cloud/storage/VolumeManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeManagerImpl.java b/server/src/com/cloud/storage/VolumeManagerImpl.java
index ff0235f..1bf092f 100644
--- a/server/src/com/cloud/storage/VolumeManagerImpl.java
+++ b/server/src/com/cloud/storage/VolumeManagerImpl.java
@@ -146,7 +146,6 @@ import com.cloud.uservm.UserVm;
 import com.cloud.utils.EnumUtils;
 import com.cloud.utils.NumbersUtil;
 import com.cloud.utils.Pair;
-import com.cloud.utils.UriUtils;
 import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.JoinBuilder;
@@ -470,10 +469,6 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
         }
         validateUrl(url);
 
-        // Check that the resource limit for secondary storage won't be exceeded
-        _resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(ownerId), ResourceType.secondary_storage,
-                UriUtils.getRemoteSize(url));
-
         return false;
     }
     
@@ -741,8 +736,6 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
         // decrement it
         _resourceLimitMgr.incrementResourceCount(volume.getAccountId(),
                 ResourceType.volume);
-        _resourceLimitMgr.incrementResourceCount(volume.getAccountId(), ResourceType.secondary_storage,
-                UriUtils.getRemoteSize(url));
 
         txn.commit();
         return volume;
@@ -913,10 +906,6 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
             _accountMgr.checkAccess(caller, null, true, snapshotCheck);
         }
 
-        // Check that the resource limit for primary storage won't be exceeded
-        _resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(ownerId), ResourceType.primary_storage,
-                new Long(size));
-
         // Verify that zone exists
         DataCenterVO zone = _dcDao.findById(zoneId);
         if (zone == null) {
@@ -985,8 +974,6 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
         // decrement it
         _resourceLimitMgr.incrementResourceCount(volume.getAccountId(),
                 ResourceType.volume);
-        _resourceLimitMgr.incrementResourceCount(volume.getAccountId(), ResourceType.primary_storage,
-                new Long(volume.getSize()));
 
         txn.commit();
 
@@ -1019,8 +1006,6 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
                         + " as volume failed to create on the backend");
                 _resourceLimitMgr.decrementResourceCount(volume.getAccountId(),
                         ResourceType.volume);
-                _resourceLimitMgr.decrementResourceCount(volume.getAccountId(), ResourceType.primary_storage,
-                        new Long(volume.getSize()));
             }
         }
     }
@@ -1028,8 +1013,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
     @Override
     @DB
     @ActionEvent(eventType = EventTypes.EVENT_VOLUME_RESIZE, eventDescription = "resizing volume", async = true)
-    public VolumeVO resizeVolume(ResizeVolumeCmd cmd)
-            throws ResourceAllocationException {
+    public VolumeVO resizeVolume(ResizeVolumeCmd cmd) {
         Long newSize = null;
         boolean shrinkOk = cmd.getShrinkOk();
         
@@ -1165,12 +1149,6 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
                             + " would shrink the volume, need to sign off by supplying the shrinkok parameter with value of true");
         }
 
-        if (!shrinkOk) {
-            /* Check resource limit for this account on primary storage resource */
-            _resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(volume.getAccountId()),
-                    ResourceType.primary_storage, new Long(newSize - currentSize));
-        }
-
         /*
          * get a list of hosts to send the commands to, try the system the
          * associated vm is running on first, then the last known place it ran.
@@ -1198,35 +1176,27 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
         ResizeVolumePayload payload = new ResizeVolumePayload(newSize, shrinkOk, instanceName, hosts);
         
         try {
-            VolumeInfo vol = this.volFactory.getVolume(volume.getId());
+        	VolumeInfo vol = this.volFactory.getVolume(volume.getId());
             vol.addPayload(payload);
-
-            AsyncCallFuture<VolumeApiResult> future = this.volService.resize(vol);
-            future.get();
-            volume = _volsDao.findById(volume.getId());
-
-            if (newDiskOffering != null) {
-                volume.setDiskOfferingId(cmd.getNewDiskOfferingId());
-            }
-            _volsDao.update(volume.getId(), volume);
-
-            /* Update resource count for the account on primary storage resource */
-            if (!shrinkOk) {
-                _resourceLimitMgr.incrementResourceCount(volume.getAccountId(), ResourceType.primary_storage,
-                        new Long(newSize - currentSize));
-            } else {
-                _resourceLimitMgr.decrementResourceCount(volume.getAccountId(), ResourceType.primary_storage,
-                        new Long(currentSize - newSize));
-            }
-            return volume;
-        } catch (InterruptedException e) {
-            s_logger.debug("failed get resize volume result", e);
-        } catch (ExecutionException e) {
-            s_logger.debug("failed get resize volume result", e);
-        } catch (Exception e) {
-            s_logger.debug("failed get resize volume result", e);
-        }
-
+            
+        	AsyncCallFuture<VolumeApiResult> future = this.volService.resize(vol);
+        	future.get();
+        	volume = _volsDao.findById(volume.getId());
+
+        	if (newDiskOffering != null) {
+        		volume.setDiskOfferingId(cmd.getNewDiskOfferingId());
+        	}
+        	_volsDao.update(volume.getId(), volume);
+
+        	return volume;
+		} catch (InterruptedException e) {
+			s_logger.debug("failed get resize volume result", e);
+		} catch (ExecutionException e) {
+			s_logger.debug("failed get resize volume result", e);
+		} catch (Exception e) {
+			s_logger.debug("failed get resize volume result", e);
+		}
+       
         return null;
     }
     
@@ -1273,19 +1243,9 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
                 VMInstanceVO vmInstance = this._vmInstanceDao.findById(instanceId);
                 if (instanceId == null
                         || (vmInstance.getType().equals(VirtualMachine.Type.User))) {
-                    // Decrement the resource count for volumes and primary storage belonging user VM's only
+                    // Decrement the resource count for volumes belonging user VM's only
                     _resourceLimitMgr.decrementResourceCount(volume.getAccountId(),
                             ResourceType.volume);
-                    /* If volume is in primary storage, decrement primary storage count else decrement secondary
-                     storage count (in case of upload volume). */
-                    if (volume.getFolder() != null) {
-                        _resourceLimitMgr.decrementResourceCount(volume.getAccountId(), ResourceType.primary_storage,
-                                new Long(volume.getSize()));
-                    } else {
-                        _resourceLimitMgr.recalculateResourceCount(volume.getAccountId(), volume.getDomainId(),
-                                ResourceType.secondary_storage.getOrdinal());
-                    }
-
                     // Log usage event for volumes belonging user VM's only
                     UsageEventVO usageEvent = new UsageEventVO(
                             EventTypes.EVENT_VOLUME_DELETE, volume.getAccountId(),
@@ -1357,8 +1317,6 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
 
             _resourceLimitMgr.incrementResourceCount(vm.getAccountId(),
                     ResourceType.volume);
-            _resourceLimitMgr.incrementResourceCount(vm.getAccountId(), ResourceType.primary_storage,
-                    new Long(vol.getSize()));
         }
         return toDiskProfile(vol, offering);
     }
@@ -1406,8 +1364,6 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
 
             _resourceLimitMgr.incrementResourceCount(vm.getAccountId(),
                     ResourceType.volume);
-            _resourceLimitMgr.incrementResourceCount(vm.getAccountId(), ResourceType.primary_storage,
-                    new Long(vol.getSize()));
         }
         return toDiskProfile(vol, offering);
     }
@@ -1479,13 +1435,6 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
             vol = copyVolume(rootDiskPool
                     , volume, vm, rootDiskTmplt,  dcVO,
                     pod,  diskVO,  svo,  rootDiskHyperType);
-            if (vol != null) {
-                // Moving of Volume is successful, decrement the volume resource count from secondary for an account and increment it into primary storage under same account.
-                _resourceLimitMgr.decrementResourceCount(volume.getAccountId(),
-                        ResourceType.secondary_storage, new Long(volume.getSize()));
-                _resourceLimitMgr.incrementResourceCount(volume.getAccountId(),
-                        ResourceType.primary_storage, new Long(volume.getSize()));
-            }
         }
         return vol;
     }
@@ -1498,23 +1447,23 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
         if (storeForRootStoreScope == null) {
             throw new CloudRuntimeException("Can't get scope of data store: " + storeForRootVol.getId());
         }
-        
+
         Scope storeForDataStoreScope = storeForDataVol.getScope();
         if (storeForDataStoreScope == null) {
             throw new CloudRuntimeException("Can't get scope of data store: " + storeForDataVol.getId());
         }
-        
+
         if (storeForDataStoreScope.getScopeType() == ScopeType.ZONE) {
             return false;
         }
-        
+
         if (storeForRootStoreScope.getScopeType() != storeForDataStoreScope.getScopeType()) {
             throw new CloudRuntimeException("Can't move volume between scope: " + storeForDataStoreScope.getScopeType() + " and " + storeForRootStoreScope.getScopeType());
         }
-       
+
         return !storeForRootStoreScope.isSameScope(storeForDataStoreScope);
     }
-    
+
     private VolumeVO sendAttachVolumeCommand(UserVmVO vm, VolumeVO volume, Long deviceId) {
         String errorMsg = "Failed to attach volume: " + volume.getName()
                 + " to VM: " + vm.getHostName();
@@ -2184,7 +2133,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
                                             + assignedPool
                                             + " assigned by deploymentPlanner");
                                 }
-                                VolumeTask task = new VolumeTask(VolumeTaskType.MIGRATE, vol, assignedPool);
+                                VolumeTask task = new VolumeTask(VolumeTaskType.MIGRATE, vol, null);
                                 tasks.add(task);
                             }
                         } else {


[33/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
ApiDispatcher: Fix uuid->id translation and throw better debug statement

Signed-off-by: Rohit Yadav <bh...@apache.org>


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

Branch: refs/heads/marvin_refactor
Commit: dd5572ad589bff8d0aeabd6a812519bb32028099
Parents: 313ac21
Author: Rohit Yadav <bh...@apache.org>
Authored: Wed Jan 23 14:56:34 2013 -0800
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:19:15 2013 +0530

----------------------------------------------------------------------
 server/src/com/cloud/api/ApiDispatcher.java |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dd5572ad/server/src/com/cloud/api/ApiDispatcher.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiDispatcher.java b/server/src/com/cloud/api/ApiDispatcher.java
index 925d90a..cfcccc5 100755
--- a/server/src/com/cloud/api/ApiDispatcher.java
+++ b/server/src/com/cloud/api/ApiDispatcher.java
@@ -153,11 +153,10 @@ public class ApiDispatcher {
                         queueSizeLimit = 1L;
                     }
 
-                    if (queueSizeLimit != null) {
+                if (queueSizeLimit != null) {
                     _asyncMgr.syncAsyncJobExecution(asyncCmd.getJob(), asyncCmd.getSyncObjType(), asyncCmd.getSyncObjId().longValue(), queueSizeLimit);
-                    } else {
-                        s_logger.trace("The queue size is unlimited, skipping the synchronizing");
-                    }
+                } else {
+                    s_logger.trace("The queue size is unlimited, skipping the synchronizing");
                 }
             }
 
@@ -371,8 +370,13 @@ public class ApiDispatcher {
         if (internalId == null) {
             if (s_logger.isDebugEnabled())
                 s_logger.debug("Object entity uuid = " + uuid + " does not exist in the database.");
+<<<<<<< HEAD
             throw new InvalidParameterValueException("Invalid parameter " + annotation.name() + " value=" + uuid
                 + " due to incorrect long value format, or entity does not exist or due to incorrect parameter annotation for the field in api cmd class.");
+=======
+            throw new InvalidParameterValueException("Invalid parameter value=" + uuid
+                + " due to incorrect long value format, or entity was not found as it may have been deleted, or due to incorrect parameter annotation for the field in api cmd.");
+>>>>>>> ApiDispatcher: Fix uuid->id translation and throw better debug statement
         }
         return internalId;
     }


[06/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
base dict object updated as **kwargs from factory

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


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

Branch: refs/heads/marvin_refactor
Commit: 511727822f4d80c3f0e3a980727593530c0ab527
Parents: 9ebc6f9
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Mon Mar 18 18:09:43 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:00:35 2013 +0530

----------------------------------------------------------------------
 .../marvin/marvin/integration/lib/base/Account.py  |    6 +++---
 .../integration/lib/base/AccountFromProject.py     |    6 +++---
 .../integration/lib/base/AccountToProject.py       |    6 +++---
 tools/marvin/marvin/integration/lib/base/Alerts.py |   12 +++++++++---
 .../marvin/marvin/integration/lib/base/ApiLimit.py |    6 +++---
 tools/marvin/marvin/integration/lib/base/Apis.py   |    6 +++---
 .../marvin/integration/lib/base/AsyncJobResult.py  |    6 +++---
 .../marvin/integration/lib/base/AsyncJobs.py       |    6 +++---
 .../integration/lib/base/AutoScalePolicies.py      |    6 +++---
 .../marvin/integration/lib/base/AutoScalePolicy.py |    6 +++---
 .../integration/lib/base/AutoScaleVmGroup.py       |    6 +++---
 .../integration/lib/base/AutoScaleVmProfile.py     |    6 +++---
 .../integration/lib/base/BigSwitchVnsDevice.py     |    6 +++---
 .../marvin/integration/lib/base/Capabilities.py    |    6 +++---
 .../marvin/marvin/integration/lib/base/Capacity.py |    6 +++---
 .../marvin/integration/lib/base/CloudIdentifier.py |    6 +++---
 .../marvin/marvin/integration/lib/base/Cluster.py  |    6 +++---
 .../marvin/integration/lib/base/Condition.py       |    6 +++---
 tools/marvin/marvin/integration/lib/base/Config.py |   11 ++++-------
 .../marvin/integration/lib/base/Configuration.py   |    6 +++---
 .../marvin/marvin/integration/lib/base/Counter.py  |    6 +++---
 .../integration/lib/base/CustomCertificate.py      |    6 +++---
 .../lib/base/DefaultNicForVirtualMachine.py        |    6 +++---
 .../integration/lib/base/DefaultZoneForAccount.py  |    6 +++---
 .../marvin/integration/lib/base/DiskOffering.py    |    6 +++---
 tools/marvin/marvin/integration/lib/base/Domain.py |    6 +++---
 .../marvin/integration/lib/base/DomainChildren.py  |    6 +++---
 .../integration/lib/base/EgressFirewallRule.py     |    6 +++---
 .../marvin/integration/lib/base/EventTypes.py      |    6 +++---
 tools/marvin/marvin/integration/lib/base/Events.py |   12 +++++++++---
 .../marvin/integration/lib/base/FirewallRule.py    |    6 +++---
 .../integration/lib/base/FromLoadBalancerRule.py   |    6 +++---
 tools/marvin/marvin/integration/lib/base/Host.py   |    6 +++---
 .../integration/lib/base/HostForMaintenance.py     |    6 +++---
 .../marvin/integration/lib/base/HostMaintenance.py |    6 +++---
 .../marvin/integration/lib/base/HostPassword.py    |    6 +++---
 .../integration/lib/base/HypervisorCapabilities.py |    6 +++---
 .../marvin/integration/lib/base/Hypervisors.py     |    6 +++---
 .../marvin/integration/lib/base/InstanceGroup.py   |    6 +++---
 .../marvin/integration/lib/base/IpAddress.py       |    6 +++---
 .../integration/lib/base/IpForwardingRule.py       |    6 +++---
 .../marvin/integration/lib/base/IpFromNic.py       |    6 +++---
 .../marvin/marvin/integration/lib/base/IpToNic.py  |    6 +++---
 tools/marvin/marvin/integration/lib/base/Iso.py    |    6 +++---
 .../marvin/integration/lib/base/IsoPermissions.py  |    6 +++---
 .../integration/lib/base/LBStickinessPolicies.py   |    6 +++---
 .../integration/lib/base/LBStickinessPolicy.py     |    6 +++---
 .../integration/lib/base/LoadBalancerRule.py       |    6 +++---
 .../lib/base/LoadBalancerRuleInstances.py          |    6 +++---
 .../marvin/marvin/integration/lib/base/Network.py  |    6 +++---
 .../marvin/integration/lib/base/NetworkACL.py      |    6 +++---
 .../marvin/integration/lib/base/NetworkDevice.py   |    6 +++---
 .../marvin/integration/lib/base/NetworkOffering.py |    6 +++---
 .../integration/lib/base/NetworkServiceProvider.py |    6 +++---
 .../integration/lib/base/NicFromVirtualMachine.py  |    6 +++---
 .../integration/lib/base/NicToVirtualMachine.py    |    6 +++---
 .../marvin/integration/lib/base/NiciraNvpDevice.py |    6 +++---
 .../lib/base/NiciraNvpDeviceNetworks.py            |    6 +++---
 tools/marvin/marvin/integration/lib/base/Nics.py   |    6 +++---
 .../marvin/integration/lib/base/OsCategories.py    |    6 +++---
 .../marvin/marvin/integration/lib/base/OsTypes.py  |    6 +++---
 .../lib/base/PasswordForVirtualMachine.py          |    6 +++---
 .../marvin/integration/lib/base/PhysicalNetwork.py |    6 +++---
 tools/marvin/marvin/integration/lib/base/Pod.py    |    6 +++---
 .../integration/lib/base/PortForwardingRule.py     |    6 +++---
 .../marvin/integration/lib/base/PrivateGateway.py  |    6 +++---
 .../marvin/marvin/integration/lib/base/Project.py  |    6 +++---
 .../marvin/integration/lib/base/ProjectAccounts.py |    6 +++---
 .../integration/lib/base/ProjectInvitation.py      |    6 +++---
 .../integration/lib/base/PublicIpAddresses.py      |    6 +++---
 tools/marvin/marvin/integration/lib/base/Region.py |    6 +++---
 .../marvin/integration/lib/base/RemoteAccessVpn.py |    6 +++---
 tools/marvin/marvin/integration/lib/base/Remove.py |    6 +++---
 .../marvin/integration/lib/base/ResourceCount.py   |    6 +++---
 .../marvin/integration/lib/base/ResourceLimit.py   |    6 +++---
 tools/marvin/marvin/integration/lib/base/Router.py |    6 +++---
 tools/marvin/marvin/integration/lib/base/S3.py     |    6 +++---
 .../lib/base/SSHKeyForVirtualMachine.py            |    6 +++---
 .../marvin/integration/lib/base/SSHKeyPair.py      |    6 +++---
 .../integration/lib/base/SecondaryStorage.py       |    6 +++---
 .../marvin/integration/lib/base/SecurityGroup.py   |    6 +++---
 .../integration/lib/base/SecurityGroupEgress.py    |    6 +++---
 .../integration/lib/base/SecurityGroupIngress.py   |    6 +++---
 .../integration/lib/base/ServiceForRouter.py       |    6 +++---
 .../integration/lib/base/ServiceForSystemVm.py     |    6 +++---
 .../lib/base/ServiceForVirtualMachine.py           |    6 +++---
 .../marvin/integration/lib/base/ServiceOffering.py |    6 +++---
 .../marvin/integration/lib/base/Simulator.py       |    6 +++---
 .../marvin/marvin/integration/lib/base/Snapshot.py |    6 +++---
 .../integration/lib/base/SnapshotPolicies.py       |    6 +++---
 .../marvin/integration/lib/base/SnapshotPolicy.py  |    6 +++---
 .../marvin/integration/lib/base/StaticNat.py       |    6 +++---
 .../marvin/integration/lib/base/StaticRoute.py     |    6 +++---
 .../integration/lib/base/StorageMaintenance.py     |    6 +++---
 .../integration/lib/base/StorageNetworkIpRange.py  |    6 +++---
 .../marvin/integration/lib/base/StoragePool.py     |    6 +++---
 .../lib/base/SupportedNetworkServices.py           |    6 +++---
 tools/marvin/marvin/integration/lib/base/Swift.py  |    6 +++---
 .../marvin/marvin/integration/lib/base/SystemVm.py |    6 +++---
 tools/marvin/marvin/integration/lib/base/Tags.py   |    6 +++---
 .../marvin/marvin/integration/lib/base/Template.py |    6 +++---
 .../integration/lib/base/TemplatePermissions.py    |    6 +++---
 .../integration/lib/base/ToLoadBalancerRule.py     |    6 +++---
 .../marvin/integration/lib/base/TrafficMonitor.py  |    6 +++---
 .../marvin/integration/lib/base/TrafficType.py     |    6 +++---
 .../lib/base/TrafficTypeImplementors.py            |    6 +++---
 .../marvin/integration/lib/base/UsageRecords.py    |    6 +++---
 .../marvin/integration/lib/base/UsageTypes.py      |    6 +++---
 tools/marvin/marvin/integration/lib/base/User.py   |    6 +++---
 .../marvin/marvin/integration/lib/base/UserKeys.py |    6 +++---
 .../marvin/integration/lib/base/VMPassword.py      |    6 +++---
 .../marvin/integration/lib/base/VMSnapshot.py      |    6 +++---
 tools/marvin/marvin/integration/lib/base/VPC.py    |    6 +++---
 .../marvin/integration/lib/base/VPCOffering.py     |    6 +++---
 .../marvin/integration/lib/base/VirtualMachine.py  |    6 +++---
 .../integration/lib/base/VirtualRouterElement.py   |    6 +++---
 .../marvin/integration/lib/base/VlanIpRange.py     |    6 +++---
 tools/marvin/marvin/integration/lib/base/Volume.py |    6 +++---
 .../marvin/integration/lib/base/VpnConnection.py   |    6 +++---
 .../integration/lib/base/VpnCustomerGateway.py     |    6 +++---
 .../marvin/integration/lib/base/VpnGateway.py      |    6 +++---
 .../marvin/marvin/integration/lib/base/VpnUser.py  |    6 +++---
 tools/marvin/marvin/integration/lib/base/Zone.py   |    6 +++---
 .../integration/lib/factory/test/testFactories.py  |   12 +++++++++++-
 .../marvin/marvin/integration/lib/generateBase.py  |    6 +++---
 125 files changed, 396 insertions(+), 377 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Account.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Account.py b/tools/marvin/marvin/integration/lib/base/Account.py
index b5ad12a..39852ef 100644
--- a/tools/marvin/marvin/integration/lib/base/Account.py
+++ b/tools/marvin/marvin/integration/lib/base/Account.py
@@ -23,11 +23,11 @@ from marvin.cloudstackAPI import updateAccount
 from marvin.cloudstackAPI import disableAccount
 from marvin.cloudstackAPI import deleteAccount
 
-class Account(CloudStackEntity):
+class Account(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def enable(self, apiclient, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/AccountFromProject.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AccountFromProject.py b/tools/marvin/marvin/integration/lib/base/AccountFromProject.py
index c90efb2..4801412 100644
--- a/tools/marvin/marvin/integration/lib/base/AccountFromProject.py
+++ b/tools/marvin/marvin/integration/lib/base/AccountFromProject.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import deleteAccountFromProject
 
-class AccountFromProject(CloudStackEntity):
+class AccountFromProject(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def delete(self, apiclient, projectid, account, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/AccountToProject.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AccountToProject.py b/tools/marvin/marvin/integration/lib/base/AccountToProject.py
index a35c851..3778ffb 100644
--- a/tools/marvin/marvin/integration/lib/base/AccountToProject.py
+++ b/tools/marvin/marvin/integration/lib/base/AccountToProject.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import addAccountToProject
 
-class AccountToProject(CloudStackEntity):
+class AccountToProject(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def add(self, apiclient, projectid, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Alerts.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Alerts.py b/tools/marvin/marvin/integration/lib/base/Alerts.py
index ebd15e1..b4e51c4 100644
--- a/tools/marvin/marvin/integration/lib/base/Alerts.py
+++ b/tools/marvin/marvin/integration/lib/base/Alerts.py
@@ -16,12 +16,13 @@
 # under the License.
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listAlerts
+from marvin.cloudstackAPI import deleteAlerts
 
-class Alerts(CloudStackEntity):
+class Alerts(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod
@@ -31,3 +32,8 @@ class Alerts(CloudStackEntity):
         alerts = apiclient.listAlerts(cmd)
         return map(lambda e: Alerts(e.__dict__), alerts)
 
+
+    def delete(self, apiclient, **kwargs):
+        cmd = deleteAlerts.deleteAlertsCmd()
+        [setattr(cmd, key, value) for key,value in kwargs.items]
+        alerts = apiclient.deleteAlerts(cmd)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/ApiLimit.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ApiLimit.py b/tools/marvin/marvin/integration/lib/base/ApiLimit.py
index c3ec025..5144be1 100644
--- a/tools/marvin/marvin/integration/lib/base/ApiLimit.py
+++ b/tools/marvin/marvin/integration/lib/base/ApiLimit.py
@@ -18,11 +18,11 @@ from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import resetApiLimit
 from marvin.cloudstackAPI import getApiLimit
 
-class ApiLimit(CloudStackEntity):
+class ApiLimit(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def reset(self, apiclient, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Apis.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Apis.py b/tools/marvin/marvin/integration/lib/base/Apis.py
index 6677763..c215930 100644
--- a/tools/marvin/marvin/integration/lib/base/Apis.py
+++ b/tools/marvin/marvin/integration/lib/base/Apis.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listApis
 
-class Apis(CloudStackEntity):
+class Apis(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/AsyncJobResult.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AsyncJobResult.py b/tools/marvin/marvin/integration/lib/base/AsyncJobResult.py
index 8d81c21..c8e57e4 100644
--- a/tools/marvin/marvin/integration/lib/base/AsyncJobResult.py
+++ b/tools/marvin/marvin/integration/lib/base/AsyncJobResult.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import queryAsyncJobResult
 
-class AsyncJobResult(CloudStackEntity):
+class AsyncJobResult(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def query(self, apiclient, jobid, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/AsyncJobs.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AsyncJobs.py b/tools/marvin/marvin/integration/lib/base/AsyncJobs.py
index 87dde3f..9b6b7aa 100644
--- a/tools/marvin/marvin/integration/lib/base/AsyncJobs.py
+++ b/tools/marvin/marvin/integration/lib/base/AsyncJobs.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listAsyncJobs
 
-class AsyncJobs(CloudStackEntity):
+class AsyncJobs(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/AutoScalePolicies.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AutoScalePolicies.py b/tools/marvin/marvin/integration/lib/base/AutoScalePolicies.py
index e0f3251..62b1887 100644
--- a/tools/marvin/marvin/integration/lib/base/AutoScalePolicies.py
+++ b/tools/marvin/marvin/integration/lib/base/AutoScalePolicies.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listAutoScalePolicies
 
-class AutoScalePolicies(CloudStackEntity):
+class AutoScalePolicies(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/AutoScalePolicy.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AutoScalePolicy.py b/tools/marvin/marvin/integration/lib/base/AutoScalePolicy.py
index 5655b48..b202bb1 100644
--- a/tools/marvin/marvin/integration/lib/base/AutoScalePolicy.py
+++ b/tools/marvin/marvin/integration/lib/base/AutoScalePolicy.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import createAutoScalePolicy
 from marvin.cloudstackAPI import updateAutoScalePolicy
 from marvin.cloudstackAPI import deleteAutoScalePolicy
 
-class AutoScalePolicy(CloudStackEntity):
+class AutoScalePolicy(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/AutoScaleVmGroup.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AutoScaleVmGroup.py b/tools/marvin/marvin/integration/lib/base/AutoScaleVmGroup.py
index 43aed7a..13aa7c7 100644
--- a/tools/marvin/marvin/integration/lib/base/AutoScaleVmGroup.py
+++ b/tools/marvin/marvin/integration/lib/base/AutoScaleVmGroup.py
@@ -22,11 +22,11 @@ from marvin.cloudstackAPI import updateAutoScaleVmGroup
 from marvin.cloudstackAPI import disableAutoScaleVmGroup
 from marvin.cloudstackAPI import deleteAutoScaleVmGroup
 
-class AutoScaleVmGroup(CloudStackEntity):
+class AutoScaleVmGroup(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def enable(self, apiclient, id, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/AutoScaleVmProfile.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AutoScaleVmProfile.py b/tools/marvin/marvin/integration/lib/base/AutoScaleVmProfile.py
index 36adbb1..bce8375 100644
--- a/tools/marvin/marvin/integration/lib/base/AutoScaleVmProfile.py
+++ b/tools/marvin/marvin/integration/lib/base/AutoScaleVmProfile.py
@@ -20,11 +20,11 @@ from marvin.cloudstackAPI import listAutoScaleVmProfiles
 from marvin.cloudstackAPI import updateAutoScaleVmProfile
 from marvin.cloudstackAPI import deleteAutoScaleVmProfile
 
-class AutoScaleVmProfile(CloudStackEntity):
+class AutoScaleVmProfile(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/BigSwitchVnsDevice.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/BigSwitchVnsDevice.py b/tools/marvin/marvin/integration/lib/base/BigSwitchVnsDevice.py
index 3bccb35..29a6b7f 100644
--- a/tools/marvin/marvin/integration/lib/base/BigSwitchVnsDevice.py
+++ b/tools/marvin/marvin/integration/lib/base/BigSwitchVnsDevice.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import addBigSwitchVnsDevice
 from marvin.cloudstackAPI import listBigSwitchVnsDevices
 from marvin.cloudstackAPI import deleteBigSwitchVnsDevice
 
-class BigSwitchVnsDevice(CloudStackEntity):
+class BigSwitchVnsDevice(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def add(self, apiclient, physicalnetworkid, hostname, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Capabilities.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Capabilities.py b/tools/marvin/marvin/integration/lib/base/Capabilities.py
index c8424f4..1969a44 100644
--- a/tools/marvin/marvin/integration/lib/base/Capabilities.py
+++ b/tools/marvin/marvin/integration/lib/base/Capabilities.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listCapabilities
 
-class Capabilities(CloudStackEntity):
+class Capabilities(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Capacity.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Capacity.py b/tools/marvin/marvin/integration/lib/base/Capacity.py
index 51ffbda..bb633ed 100644
--- a/tools/marvin/marvin/integration/lib/base/Capacity.py
+++ b/tools/marvin/marvin/integration/lib/base/Capacity.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listCapacity
 
-class Capacity(CloudStackEntity):
+class Capacity(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/CloudIdentifier.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/CloudIdentifier.py b/tools/marvin/marvin/integration/lib/base/CloudIdentifier.py
index 6a6f237..9dfe2db 100644
--- a/tools/marvin/marvin/integration/lib/base/CloudIdentifier.py
+++ b/tools/marvin/marvin/integration/lib/base/CloudIdentifier.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import getCloudIdentifier
 
-class CloudIdentifier(CloudStackEntity):
+class CloudIdentifier(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def get(self, apiclient, userid, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Cluster.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Cluster.py b/tools/marvin/marvin/integration/lib/base/Cluster.py
index da1130d..72bfcdc 100644
--- a/tools/marvin/marvin/integration/lib/base/Cluster.py
+++ b/tools/marvin/marvin/integration/lib/base/Cluster.py
@@ -20,11 +20,11 @@ from marvin.cloudstackAPI import listClusters
 from marvin.cloudstackAPI import updateCluster
 from marvin.cloudstackAPI import deleteCluster
 
-class Cluster(CloudStackEntity):
+class Cluster(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def add(self, apiclient, clustername, hypervisor, zoneid, clustertype, podid, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Condition.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Condition.py b/tools/marvin/marvin/integration/lib/base/Condition.py
index 5973956..93d203d 100644
--- a/tools/marvin/marvin/integration/lib/base/Condition.py
+++ b/tools/marvin/marvin/integration/lib/base/Condition.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import createCondition
 from marvin.cloudstackAPI import listConditions
 from marvin.cloudstackAPI import deleteCondition
 
-class Condition(CloudStackEntity):
+class Condition(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Config.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Config.py b/tools/marvin/marvin/integration/lib/base/Config.py
index fc6ce9d..51d00ac 100644
--- a/tools/marvin/marvin/integration/lib/base/Config.py
+++ b/tools/marvin/marvin/integration/lib/base/Config.py
@@ -17,18 +17,15 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import ldapConfig
 
-class Config(CloudStackEntity):
+class Config(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
-    def ldap(self, apiclient, queryfilter, hostname, searchbase, **kwargs):
+    def ldap(self, apiclient, **kwargs):
         cmd = ldapConfig.ldapConfigCmd()
-        cmd.hostname = hostname
-        cmd.queryfilter = queryfilter
-        cmd.searchbase = searchbase
         [setattr(cmd, key, value) for key,value in kwargs.items]
         config = apiclient.ldapConfig(cmd)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Configuration.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Configuration.py b/tools/marvin/marvin/integration/lib/base/Configuration.py
index 72d267f..865f4e1 100644
--- a/tools/marvin/marvin/integration/lib/base/Configuration.py
+++ b/tools/marvin/marvin/integration/lib/base/Configuration.py
@@ -18,11 +18,11 @@ from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listConfigurations
 from marvin.cloudstackAPI import updateConfiguration
 
-class Configuration(CloudStackEntity):
+class Configuration(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Counter.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Counter.py b/tools/marvin/marvin/integration/lib/base/Counter.py
index e41ce12..383d184 100644
--- a/tools/marvin/marvin/integration/lib/base/Counter.py
+++ b/tools/marvin/marvin/integration/lib/base/Counter.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import createCounter
 from marvin.cloudstackAPI import listCounters
 from marvin.cloudstackAPI import deleteCounter
 
-class Counter(CloudStackEntity):
+class Counter(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/CustomCertificate.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/CustomCertificate.py b/tools/marvin/marvin/integration/lib/base/CustomCertificate.py
index 3dcbd73..472e8a2 100644
--- a/tools/marvin/marvin/integration/lib/base/CustomCertificate.py
+++ b/tools/marvin/marvin/integration/lib/base/CustomCertificate.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import uploadCustomCertificate
 
-class CustomCertificate(CloudStackEntity):
+class CustomCertificate(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def upload(self, apiclient, domainsuffix, certificate, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/DefaultNicForVirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/DefaultNicForVirtualMachine.py b/tools/marvin/marvin/integration/lib/base/DefaultNicForVirtualMachine.py
index 97d362d..33e5bfe 100644
--- a/tools/marvin/marvin/integration/lib/base/DefaultNicForVirtualMachine.py
+++ b/tools/marvin/marvin/integration/lib/base/DefaultNicForVirtualMachine.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import updateDefaultNicForVirtualMachine
 
-class DefaultNicForVirtualMachine(CloudStackEntity):
+class DefaultNicForVirtualMachine(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def update(self, apiclient, nicid, virtualmachineid, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/DefaultZoneForAccount.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/DefaultZoneForAccount.py b/tools/marvin/marvin/integration/lib/base/DefaultZoneForAccount.py
index d31b5cc..1c636c9 100644
--- a/tools/marvin/marvin/integration/lib/base/DefaultZoneForAccount.py
+++ b/tools/marvin/marvin/integration/lib/base/DefaultZoneForAccount.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import markDefaultZoneForAccount
 
-class DefaultZoneForAccount(CloudStackEntity):
+class DefaultZoneForAccount(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def mark(self, apiclient, account, domainid, zoneid, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/DiskOffering.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/DiskOffering.py b/tools/marvin/marvin/integration/lib/base/DiskOffering.py
index a94412a..005adde 100644
--- a/tools/marvin/marvin/integration/lib/base/DiskOffering.py
+++ b/tools/marvin/marvin/integration/lib/base/DiskOffering.py
@@ -20,11 +20,11 @@ from marvin.cloudstackAPI import listDiskOfferings
 from marvin.cloudstackAPI import updateDiskOffering
 from marvin.cloudstackAPI import deleteDiskOffering
 
-class DiskOffering(CloudStackEntity):
+class DiskOffering(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Domain.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Domain.py b/tools/marvin/marvin/integration/lib/base/Domain.py
index 2d66d2e..c1d4fc2 100644
--- a/tools/marvin/marvin/integration/lib/base/Domain.py
+++ b/tools/marvin/marvin/integration/lib/base/Domain.py
@@ -20,11 +20,11 @@ from marvin.cloudstackAPI import listDomains
 from marvin.cloudstackAPI import updateDomain
 from marvin.cloudstackAPI import deleteDomain
 
-class Domain(CloudStackEntity):
+class Domain(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/DomainChildren.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/DomainChildren.py b/tools/marvin/marvin/integration/lib/base/DomainChildren.py
index bb8d3a1..f276538 100644
--- a/tools/marvin/marvin/integration/lib/base/DomainChildren.py
+++ b/tools/marvin/marvin/integration/lib/base/DomainChildren.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listDomainChildren
 
-class DomainChildren(CloudStackEntity):
+class DomainChildren(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/EgressFirewallRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/EgressFirewallRule.py b/tools/marvin/marvin/integration/lib/base/EgressFirewallRule.py
index 750ccea..98fc9bb 100644
--- a/tools/marvin/marvin/integration/lib/base/EgressFirewallRule.py
+++ b/tools/marvin/marvin/integration/lib/base/EgressFirewallRule.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import createEgressFirewallRule
 from marvin.cloudstackAPI import listEgressFirewallRules
 from marvin.cloudstackAPI import deleteEgressFirewallRule
 
-class EgressFirewallRule(CloudStackEntity):
+class EgressFirewallRule(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/EventTypes.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/EventTypes.py b/tools/marvin/marvin/integration/lib/base/EventTypes.py
index 85bf201..46b8da0 100644
--- a/tools/marvin/marvin/integration/lib/base/EventTypes.py
+++ b/tools/marvin/marvin/integration/lib/base/EventTypes.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listEventTypes
 
-class EventTypes(CloudStackEntity):
+class EventTypes(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Events.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Events.py b/tools/marvin/marvin/integration/lib/base/Events.py
index e860eb5..9f0d4cd 100644
--- a/tools/marvin/marvin/integration/lib/base/Events.py
+++ b/tools/marvin/marvin/integration/lib/base/Events.py
@@ -16,12 +16,13 @@
 # under the License.
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listEvents
+from marvin.cloudstackAPI import deleteEvents
 
-class Events(CloudStackEntity):
+class Events(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod
@@ -31,3 +32,8 @@ class Events(CloudStackEntity):
         events = apiclient.listEvents(cmd)
         return map(lambda e: Events(e.__dict__), events)
 
+
+    def delete(self, apiclient, **kwargs):
+        cmd = deleteEvents.deleteEventsCmd()
+        [setattr(cmd, key, value) for key,value in kwargs.items]
+        events = apiclient.deleteEvents(cmd)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/FirewallRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/FirewallRule.py b/tools/marvin/marvin/integration/lib/base/FirewallRule.py
index 2e90907..6744edc 100644
--- a/tools/marvin/marvin/integration/lib/base/FirewallRule.py
+++ b/tools/marvin/marvin/integration/lib/base/FirewallRule.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import createFirewallRule
 from marvin.cloudstackAPI import listFirewallRules
 from marvin.cloudstackAPI import deleteFirewallRule
 
-class FirewallRule(CloudStackEntity):
+class FirewallRule(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/FromLoadBalancerRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/FromLoadBalancerRule.py b/tools/marvin/marvin/integration/lib/base/FromLoadBalancerRule.py
index a849d1e..38da697 100644
--- a/tools/marvin/marvin/integration/lib/base/FromLoadBalancerRule.py
+++ b/tools/marvin/marvin/integration/lib/base/FromLoadBalancerRule.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import removeFromLoadBalancerRule
 
-class FromLoadBalancerRule(CloudStackEntity):
+class FromLoadBalancerRule(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def remove(self, apiclient, id, virtualmachineids, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Host.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Host.py b/tools/marvin/marvin/integration/lib/base/Host.py
index 4ab0ab6..dbc1ef6 100644
--- a/tools/marvin/marvin/integration/lib/base/Host.py
+++ b/tools/marvin/marvin/integration/lib/base/Host.py
@@ -21,11 +21,11 @@ from marvin.cloudstackAPI import updateHost
 from marvin.cloudstackAPI import reconnectHost
 from marvin.cloudstackAPI import deleteHost
 
-class Host(CloudStackEntity):
+class Host(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def add(self, apiclient, username, podid, url, hypervisor, zoneid, password, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/HostForMaintenance.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/HostForMaintenance.py b/tools/marvin/marvin/integration/lib/base/HostForMaintenance.py
index 6f6fe16..663da86 100644
--- a/tools/marvin/marvin/integration/lib/base/HostForMaintenance.py
+++ b/tools/marvin/marvin/integration/lib/base/HostForMaintenance.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import prepareHostForMaintenance
 
-class HostForMaintenance(CloudStackEntity):
+class HostForMaintenance(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def prepare(self, apiclient, id, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/HostMaintenance.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/HostMaintenance.py b/tools/marvin/marvin/integration/lib/base/HostMaintenance.py
index 7b2de90..9dba5fc 100644
--- a/tools/marvin/marvin/integration/lib/base/HostMaintenance.py
+++ b/tools/marvin/marvin/integration/lib/base/HostMaintenance.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import cancelHostMaintenance
 
-class HostMaintenance(CloudStackEntity):
+class HostMaintenance(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def cancel(self, apiclient, id, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/HostPassword.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/HostPassword.py b/tools/marvin/marvin/integration/lib/base/HostPassword.py
index d2d183f..0c64f2a 100644
--- a/tools/marvin/marvin/integration/lib/base/HostPassword.py
+++ b/tools/marvin/marvin/integration/lib/base/HostPassword.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import updateHostPassword
 
-class HostPassword(CloudStackEntity):
+class HostPassword(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def update(self, apiclient, username, password, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/HypervisorCapabilities.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/HypervisorCapabilities.py b/tools/marvin/marvin/integration/lib/base/HypervisorCapabilities.py
index 0b5ba5b..4ee57b5 100644
--- a/tools/marvin/marvin/integration/lib/base/HypervisorCapabilities.py
+++ b/tools/marvin/marvin/integration/lib/base/HypervisorCapabilities.py
@@ -18,11 +18,11 @@ from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listHypervisorCapabilities
 from marvin.cloudstackAPI import updateHypervisorCapabilities
 
-class HypervisorCapabilities(CloudStackEntity):
+class HypervisorCapabilities(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Hypervisors.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Hypervisors.py b/tools/marvin/marvin/integration/lib/base/Hypervisors.py
index 1849334..5e34aed 100644
--- a/tools/marvin/marvin/integration/lib/base/Hypervisors.py
+++ b/tools/marvin/marvin/integration/lib/base/Hypervisors.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listHypervisors
 
-class Hypervisors(CloudStackEntity):
+class Hypervisors(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/InstanceGroup.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/InstanceGroup.py b/tools/marvin/marvin/integration/lib/base/InstanceGroup.py
index 852b7f4..24c768a 100644
--- a/tools/marvin/marvin/integration/lib/base/InstanceGroup.py
+++ b/tools/marvin/marvin/integration/lib/base/InstanceGroup.py
@@ -20,11 +20,11 @@ from marvin.cloudstackAPI import listInstanceGroups
 from marvin.cloudstackAPI import updateInstanceGroup
 from marvin.cloudstackAPI import deleteInstanceGroup
 
-class InstanceGroup(CloudStackEntity):
+class InstanceGroup(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/IpAddress.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/IpAddress.py b/tools/marvin/marvin/integration/lib/base/IpAddress.py
index aedb8d8..74f59b1 100644
--- a/tools/marvin/marvin/integration/lib/base/IpAddress.py
+++ b/tools/marvin/marvin/integration/lib/base/IpAddress.py
@@ -18,11 +18,11 @@ from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import disassociateIpAddress
 from marvin.cloudstackAPI import associateIpAddress
 
-class IpAddress(CloudStackEntity):
+class IpAddress(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def disassociate(self, apiclient, id, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/IpForwardingRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/IpForwardingRule.py b/tools/marvin/marvin/integration/lib/base/IpForwardingRule.py
index 0279f15..69cc343 100644
--- a/tools/marvin/marvin/integration/lib/base/IpForwardingRule.py
+++ b/tools/marvin/marvin/integration/lib/base/IpForwardingRule.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import createIpForwardingRule
 from marvin.cloudstackAPI import listIpForwardingRules
 from marvin.cloudstackAPI import deleteIpForwardingRule
 
-class IpForwardingRule(CloudStackEntity):
+class IpForwardingRule(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/IpFromNic.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/IpFromNic.py b/tools/marvin/marvin/integration/lib/base/IpFromNic.py
index 750e142..c48f026 100644
--- a/tools/marvin/marvin/integration/lib/base/IpFromNic.py
+++ b/tools/marvin/marvin/integration/lib/base/IpFromNic.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import removeIpFromNic
 
-class IpFromNic(CloudStackEntity):
+class IpFromNic(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def remove(self, apiclient, id, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/IpToNic.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/IpToNic.py b/tools/marvin/marvin/integration/lib/base/IpToNic.py
index 713c07d..ce78015 100644
--- a/tools/marvin/marvin/integration/lib/base/IpToNic.py
+++ b/tools/marvin/marvin/integration/lib/base/IpToNic.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import addIpToNic
 
-class IpToNic(CloudStackEntity):
+class IpToNic(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def add(self, apiclient, nicid, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Iso.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Iso.py b/tools/marvin/marvin/integration/lib/base/Iso.py
index b8ab501..5865a2d 100644
--- a/tools/marvin/marvin/integration/lib/base/Iso.py
+++ b/tools/marvin/marvin/integration/lib/base/Iso.py
@@ -24,11 +24,11 @@ from marvin.cloudstackAPI import detachIso
 from marvin.cloudstackAPI import extractIso
 from marvin.cloudstackAPI import deleteIso
 
-class Iso(CloudStackEntity):
+class Iso(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def copy(self, apiclient, sourcezoneid, id, destzoneid, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/IsoPermissions.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/IsoPermissions.py b/tools/marvin/marvin/integration/lib/base/IsoPermissions.py
index 8df2e48..b77f1aa 100644
--- a/tools/marvin/marvin/integration/lib/base/IsoPermissions.py
+++ b/tools/marvin/marvin/integration/lib/base/IsoPermissions.py
@@ -18,11 +18,11 @@ from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listIsoPermissions
 from marvin.cloudstackAPI import updateIsoPermissions
 
-class IsoPermissions(CloudStackEntity):
+class IsoPermissions(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/LBStickinessPolicies.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/LBStickinessPolicies.py b/tools/marvin/marvin/integration/lib/base/LBStickinessPolicies.py
index 30a077d..fd93b51 100644
--- a/tools/marvin/marvin/integration/lib/base/LBStickinessPolicies.py
+++ b/tools/marvin/marvin/integration/lib/base/LBStickinessPolicies.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listLBStickinessPolicies
 
-class LBStickinessPolicies(CloudStackEntity):
+class LBStickinessPolicies(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/LBStickinessPolicy.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/LBStickinessPolicy.py b/tools/marvin/marvin/integration/lib/base/LBStickinessPolicy.py
index f5b5613..49a59aa 100644
--- a/tools/marvin/marvin/integration/lib/base/LBStickinessPolicy.py
+++ b/tools/marvin/marvin/integration/lib/base/LBStickinessPolicy.py
@@ -18,11 +18,11 @@ from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import createLBStickinessPolicy
 from marvin.cloudstackAPI import deleteLBStickinessPolicy
 
-class LBStickinessPolicy(CloudStackEntity):
+class LBStickinessPolicy(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/LoadBalancerRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/LoadBalancerRule.py b/tools/marvin/marvin/integration/lib/base/LoadBalancerRule.py
index dc2c8ea..cd2af16 100644
--- a/tools/marvin/marvin/integration/lib/base/LoadBalancerRule.py
+++ b/tools/marvin/marvin/integration/lib/base/LoadBalancerRule.py
@@ -20,11 +20,11 @@ from marvin.cloudstackAPI import listLoadBalancerRules
 from marvin.cloudstackAPI import updateLoadBalancerRule
 from marvin.cloudstackAPI import deleteLoadBalancerRule
 
-class LoadBalancerRule(CloudStackEntity):
+class LoadBalancerRule(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/LoadBalancerRuleInstances.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/LoadBalancerRuleInstances.py b/tools/marvin/marvin/integration/lib/base/LoadBalancerRuleInstances.py
index 2ea5545..f4b6a54 100644
--- a/tools/marvin/marvin/integration/lib/base/LoadBalancerRuleInstances.py
+++ b/tools/marvin/marvin/integration/lib/base/LoadBalancerRuleInstances.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listLoadBalancerRuleInstances
 
-class LoadBalancerRuleInstances(CloudStackEntity):
+class LoadBalancerRuleInstances(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Network.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Network.py b/tools/marvin/marvin/integration/lib/base/Network.py
index 1abfbc8..9f1a86e 100644
--- a/tools/marvin/marvin/integration/lib/base/Network.py
+++ b/tools/marvin/marvin/integration/lib/base/Network.py
@@ -21,11 +21,11 @@ from marvin.cloudstackAPI import updateNetwork
 from marvin.cloudstackAPI import restartNetwork
 from marvin.cloudstackAPI import deleteNetwork
 
-class Network(CloudStackEntity):
+class Network(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/NetworkACL.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/NetworkACL.py b/tools/marvin/marvin/integration/lib/base/NetworkACL.py
index 82e0f25..74ca402 100644
--- a/tools/marvin/marvin/integration/lib/base/NetworkACL.py
+++ b/tools/marvin/marvin/integration/lib/base/NetworkACL.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import createNetworkACL
 from marvin.cloudstackAPI import listNetworkACLs
 from marvin.cloudstackAPI import deleteNetworkACL
 
-class NetworkACL(CloudStackEntity):
+class NetworkACL(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/NetworkDevice.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/NetworkDevice.py b/tools/marvin/marvin/integration/lib/base/NetworkDevice.py
index 073a328..6674111 100644
--- a/tools/marvin/marvin/integration/lib/base/NetworkDevice.py
+++ b/tools/marvin/marvin/integration/lib/base/NetworkDevice.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import addNetworkDevice
 from marvin.cloudstackAPI import listNetworkDevice
 from marvin.cloudstackAPI import deleteNetworkDevice
 
-class NetworkDevice(CloudStackEntity):
+class NetworkDevice(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def add(self, apiclient, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/NetworkOffering.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/NetworkOffering.py b/tools/marvin/marvin/integration/lib/base/NetworkOffering.py
index 41a57d4..e020de0 100644
--- a/tools/marvin/marvin/integration/lib/base/NetworkOffering.py
+++ b/tools/marvin/marvin/integration/lib/base/NetworkOffering.py
@@ -20,11 +20,11 @@ from marvin.cloudstackAPI import listNetworkOfferings
 from marvin.cloudstackAPI import updateNetworkOffering
 from marvin.cloudstackAPI import deleteNetworkOffering
 
-class NetworkOffering(CloudStackEntity):
+class NetworkOffering(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/NetworkServiceProvider.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/NetworkServiceProvider.py b/tools/marvin/marvin/integration/lib/base/NetworkServiceProvider.py
index e2b3ac8..6135a93 100644
--- a/tools/marvin/marvin/integration/lib/base/NetworkServiceProvider.py
+++ b/tools/marvin/marvin/integration/lib/base/NetworkServiceProvider.py
@@ -20,11 +20,11 @@ from marvin.cloudstackAPI import listNetworkServiceProviders
 from marvin.cloudstackAPI import updateNetworkServiceProvider
 from marvin.cloudstackAPI import deleteNetworkServiceProvider
 
-class NetworkServiceProvider(CloudStackEntity):
+class NetworkServiceProvider(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def add(self, apiclient, physicalnetworkid, name, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/NicFromVirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/NicFromVirtualMachine.py b/tools/marvin/marvin/integration/lib/base/NicFromVirtualMachine.py
index 9a56850..0705188 100644
--- a/tools/marvin/marvin/integration/lib/base/NicFromVirtualMachine.py
+++ b/tools/marvin/marvin/integration/lib/base/NicFromVirtualMachine.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import removeNicFromVirtualMachine
 
-class NicFromVirtualMachine(CloudStackEntity):
+class NicFromVirtualMachine(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def remove(self, apiclient, nicid, virtualmachineid, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/NicToVirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/NicToVirtualMachine.py b/tools/marvin/marvin/integration/lib/base/NicToVirtualMachine.py
index 8d4f6c3..f4de361 100644
--- a/tools/marvin/marvin/integration/lib/base/NicToVirtualMachine.py
+++ b/tools/marvin/marvin/integration/lib/base/NicToVirtualMachine.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import addNicToVirtualMachine
 
-class NicToVirtualMachine(CloudStackEntity):
+class NicToVirtualMachine(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def add(self, apiclient, networkid, virtualmachineid, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/NiciraNvpDevice.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/NiciraNvpDevice.py b/tools/marvin/marvin/integration/lib/base/NiciraNvpDevice.py
index 706f944..2c5ddbb 100644
--- a/tools/marvin/marvin/integration/lib/base/NiciraNvpDevice.py
+++ b/tools/marvin/marvin/integration/lib/base/NiciraNvpDevice.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import addNiciraNvpDevice
 from marvin.cloudstackAPI import listNiciraNvpDevices
 from marvin.cloudstackAPI import deleteNiciraNvpDevice
 
-class NiciraNvpDevice(CloudStackEntity):
+class NiciraNvpDevice(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def add(self, apiclient, username, physicalnetworkid, password, hostname, transportzoneuuid, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/NiciraNvpDeviceNetworks.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/NiciraNvpDeviceNetworks.py b/tools/marvin/marvin/integration/lib/base/NiciraNvpDeviceNetworks.py
index 070eb00..0a7bf39 100644
--- a/tools/marvin/marvin/integration/lib/base/NiciraNvpDeviceNetworks.py
+++ b/tools/marvin/marvin/integration/lib/base/NiciraNvpDeviceNetworks.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listNiciraNvpDeviceNetworks
 
-class NiciraNvpDeviceNetworks(CloudStackEntity):
+class NiciraNvpDeviceNetworks(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Nics.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Nics.py b/tools/marvin/marvin/integration/lib/base/Nics.py
index 57338ce..6264d85 100644
--- a/tools/marvin/marvin/integration/lib/base/Nics.py
+++ b/tools/marvin/marvin/integration/lib/base/Nics.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listNics
 
-class Nics(CloudStackEntity):
+class Nics(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/OsCategories.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/OsCategories.py b/tools/marvin/marvin/integration/lib/base/OsCategories.py
index f773211..aee9d51 100644
--- a/tools/marvin/marvin/integration/lib/base/OsCategories.py
+++ b/tools/marvin/marvin/integration/lib/base/OsCategories.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listOsCategories
 
-class OsCategories(CloudStackEntity):
+class OsCategories(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/OsTypes.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/OsTypes.py b/tools/marvin/marvin/integration/lib/base/OsTypes.py
index 5f3a3fd..1d8c3f1 100644
--- a/tools/marvin/marvin/integration/lib/base/OsTypes.py
+++ b/tools/marvin/marvin/integration/lib/base/OsTypes.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listOsTypes
 
-class OsTypes(CloudStackEntity):
+class OsTypes(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/PasswordForVirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/PasswordForVirtualMachine.py b/tools/marvin/marvin/integration/lib/base/PasswordForVirtualMachine.py
index 020959b..ec40385 100644
--- a/tools/marvin/marvin/integration/lib/base/PasswordForVirtualMachine.py
+++ b/tools/marvin/marvin/integration/lib/base/PasswordForVirtualMachine.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import resetPasswordForVirtualMachine
 
-class PasswordForVirtualMachine(CloudStackEntity):
+class PasswordForVirtualMachine(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def reset(self, apiclient, id, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/PhysicalNetwork.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/PhysicalNetwork.py b/tools/marvin/marvin/integration/lib/base/PhysicalNetwork.py
index 69be06b..050e3d6 100644
--- a/tools/marvin/marvin/integration/lib/base/PhysicalNetwork.py
+++ b/tools/marvin/marvin/integration/lib/base/PhysicalNetwork.py
@@ -20,11 +20,11 @@ from marvin.cloudstackAPI import listPhysicalNetworks
 from marvin.cloudstackAPI import updatePhysicalNetwork
 from marvin.cloudstackAPI import deletePhysicalNetwork
 
-class PhysicalNetwork(CloudStackEntity):
+class PhysicalNetwork(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Pod.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Pod.py b/tools/marvin/marvin/integration/lib/base/Pod.py
index d3d822f..db2b307 100644
--- a/tools/marvin/marvin/integration/lib/base/Pod.py
+++ b/tools/marvin/marvin/integration/lib/base/Pod.py
@@ -20,11 +20,11 @@ from marvin.cloudstackAPI import listPods
 from marvin.cloudstackAPI import updatePod
 from marvin.cloudstackAPI import deletePod
 
-class Pod(CloudStackEntity):
+class Pod(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/PortForwardingRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/PortForwardingRule.py b/tools/marvin/marvin/integration/lib/base/PortForwardingRule.py
index 5d69a1a..2fd8817 100644
--- a/tools/marvin/marvin/integration/lib/base/PortForwardingRule.py
+++ b/tools/marvin/marvin/integration/lib/base/PortForwardingRule.py
@@ -20,11 +20,11 @@ from marvin.cloudstackAPI import listPortForwardingRules
 from marvin.cloudstackAPI import updatePortForwardingRule
 from marvin.cloudstackAPI import deletePortForwardingRule
 
-class PortForwardingRule(CloudStackEntity):
+class PortForwardingRule(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/PrivateGateway.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/PrivateGateway.py b/tools/marvin/marvin/integration/lib/base/PrivateGateway.py
index c121cc0..9a8949b 100644
--- a/tools/marvin/marvin/integration/lib/base/PrivateGateway.py
+++ b/tools/marvin/marvin/integration/lib/base/PrivateGateway.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import createPrivateGateway
 from marvin.cloudstackAPI import listPrivateGateways
 from marvin.cloudstackAPI import deletePrivateGateway
 
-class PrivateGateway(CloudStackEntity):
+class PrivateGateway(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Project.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Project.py b/tools/marvin/marvin/integration/lib/base/Project.py
index 8ca176e..82665c0 100644
--- a/tools/marvin/marvin/integration/lib/base/Project.py
+++ b/tools/marvin/marvin/integration/lib/base/Project.py
@@ -22,11 +22,11 @@ from marvin.cloudstackAPI import updateProject
 from marvin.cloudstackAPI import activateProject
 from marvin.cloudstackAPI import deleteProject
 
-class Project(CloudStackEntity):
+class Project(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def suspend(self, apiclient, id, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/ProjectAccounts.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ProjectAccounts.py b/tools/marvin/marvin/integration/lib/base/ProjectAccounts.py
index 5eb1394..f3dd837 100644
--- a/tools/marvin/marvin/integration/lib/base/ProjectAccounts.py
+++ b/tools/marvin/marvin/integration/lib/base/ProjectAccounts.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listProjectAccounts
 
-class ProjectAccounts(CloudStackEntity):
+class ProjectAccounts(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/ProjectInvitation.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ProjectInvitation.py b/tools/marvin/marvin/integration/lib/base/ProjectInvitation.py
index e93fc66..b907d65 100644
--- a/tools/marvin/marvin/integration/lib/base/ProjectInvitation.py
+++ b/tools/marvin/marvin/integration/lib/base/ProjectInvitation.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import listProjectInvitations
 from marvin.cloudstackAPI import updateProjectInvitation
 from marvin.cloudstackAPI import deleteProjectInvitation
 
-class ProjectInvitation(CloudStackEntity):
+class ProjectInvitation(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/PublicIpAddresses.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/PublicIpAddresses.py b/tools/marvin/marvin/integration/lib/base/PublicIpAddresses.py
index 092ceba..8952635 100644
--- a/tools/marvin/marvin/integration/lib/base/PublicIpAddresses.py
+++ b/tools/marvin/marvin/integration/lib/base/PublicIpAddresses.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listPublicIpAddresses
 
-class PublicIpAddresses(CloudStackEntity):
+class PublicIpAddresses(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Region.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Region.py b/tools/marvin/marvin/integration/lib/base/Region.py
index 03631ab..33442a0 100644
--- a/tools/marvin/marvin/integration/lib/base/Region.py
+++ b/tools/marvin/marvin/integration/lib/base/Region.py
@@ -20,11 +20,11 @@ from marvin.cloudstackAPI import listRegions
 from marvin.cloudstackAPI import updateRegion
 from marvin.cloudstackAPI import removeRegion
 
-class Region(CloudStackEntity):
+class Region(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def add(self, apiclient, endpoint, id, name, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/RemoteAccessVpn.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/RemoteAccessVpn.py b/tools/marvin/marvin/integration/lib/base/RemoteAccessVpn.py
index 047559f..8d8f2d0 100644
--- a/tools/marvin/marvin/integration/lib/base/RemoteAccessVpn.py
+++ b/tools/marvin/marvin/integration/lib/base/RemoteAccessVpn.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import createRemoteAccessVpn
 from marvin.cloudstackAPI import listRemoteAccessVpns
 from marvin.cloudstackAPI import deleteRemoteAccessVpn
 
-class RemoteAccessVpn(CloudStackEntity):
+class RemoteAccessVpn(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Remove.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Remove.py b/tools/marvin/marvin/integration/lib/base/Remove.py
index 39e26b0..e15da60 100644
--- a/tools/marvin/marvin/integration/lib/base/Remove.py
+++ b/tools/marvin/marvin/integration/lib/base/Remove.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import ldapRemove
 
-class Remove(CloudStackEntity):
+class Remove(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def ldap(self, apiclient, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/ResourceCount.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ResourceCount.py b/tools/marvin/marvin/integration/lib/base/ResourceCount.py
index b6aaf7c..4a0fb36 100644
--- a/tools/marvin/marvin/integration/lib/base/ResourceCount.py
+++ b/tools/marvin/marvin/integration/lib/base/ResourceCount.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import updateResourceCount
 
-class ResourceCount(CloudStackEntity):
+class ResourceCount(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def update(self, apiclient, domainid, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/ResourceLimit.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ResourceLimit.py b/tools/marvin/marvin/integration/lib/base/ResourceLimit.py
index 7d1f3d8..6269c00 100644
--- a/tools/marvin/marvin/integration/lib/base/ResourceLimit.py
+++ b/tools/marvin/marvin/integration/lib/base/ResourceLimit.py
@@ -18,11 +18,11 @@ from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import listResourceLimits
 from marvin.cloudstackAPI import updateResourceLimit
 
-class ResourceLimit(CloudStackEntity):
+class ResourceLimit(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/Router.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Router.py b/tools/marvin/marvin/integration/lib/base/Router.py
index 7499593..22e9c63 100644
--- a/tools/marvin/marvin/integration/lib/base/Router.py
+++ b/tools/marvin/marvin/integration/lib/base/Router.py
@@ -21,11 +21,11 @@ from marvin.cloudstackAPI import stopRouter
 from marvin.cloudstackAPI import rebootRouter
 from marvin.cloudstackAPI import startRouter
 
-class Router(CloudStackEntity):
+class Router(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def destroy(self, apiclient, id, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/S3.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/S3.py b/tools/marvin/marvin/integration/lib/base/S3.py
index 3d6f820..1da8f94 100644
--- a/tools/marvin/marvin/integration/lib/base/S3.py
+++ b/tools/marvin/marvin/integration/lib/base/S3.py
@@ -18,11 +18,11 @@ from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import addS3
 from marvin.cloudstackAPI import listS3s
 
-class S3(CloudStackEntity):
+class S3(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def add(self, apiclient, secretkey, accesskey, bucket, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/SSHKeyForVirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SSHKeyForVirtualMachine.py b/tools/marvin/marvin/integration/lib/base/SSHKeyForVirtualMachine.py
index a55174b..a7fd912 100644
--- a/tools/marvin/marvin/integration/lib/base/SSHKeyForVirtualMachine.py
+++ b/tools/marvin/marvin/integration/lib/base/SSHKeyForVirtualMachine.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import resetSSHKeyForVirtualMachine
 
-class SSHKeyForVirtualMachine(CloudStackEntity):
+class SSHKeyForVirtualMachine(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def reset(self, apiclient, keypair, id, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/SSHKeyPair.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SSHKeyPair.py b/tools/marvin/marvin/integration/lib/base/SSHKeyPair.py
index 88859d5..416134b 100644
--- a/tools/marvin/marvin/integration/lib/base/SSHKeyPair.py
+++ b/tools/marvin/marvin/integration/lib/base/SSHKeyPair.py
@@ -20,11 +20,11 @@ from marvin.cloudstackAPI import registerSSHKeyPair
 from marvin.cloudstackAPI import listSSHKeyPairs
 from marvin.cloudstackAPI import deleteSSHKeyPair
 
-class SSHKeyPair(CloudStackEntity):
+class SSHKeyPair(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/SecondaryStorage.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SecondaryStorage.py b/tools/marvin/marvin/integration/lib/base/SecondaryStorage.py
index 785506a..51cbd9d 100644
--- a/tools/marvin/marvin/integration/lib/base/SecondaryStorage.py
+++ b/tools/marvin/marvin/integration/lib/base/SecondaryStorage.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import addSecondaryStorage
 
-class SecondaryStorage(CloudStackEntity):
+class SecondaryStorage(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def add(self, apiclient, url, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/SecurityGroup.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SecurityGroup.py b/tools/marvin/marvin/integration/lib/base/SecurityGroup.py
index 9103538..0790404 100644
--- a/tools/marvin/marvin/integration/lib/base/SecurityGroup.py
+++ b/tools/marvin/marvin/integration/lib/base/SecurityGroup.py
@@ -19,11 +19,11 @@ from marvin.cloudstackAPI import createSecurityGroup
 from marvin.cloudstackAPI import listSecurityGroups
 from marvin.cloudstackAPI import deleteSecurityGroup
 
-class SecurityGroup(CloudStackEntity):
+class SecurityGroup(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/SecurityGroupEgress.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SecurityGroupEgress.py b/tools/marvin/marvin/integration/lib/base/SecurityGroupEgress.py
index dc37e7c..f97077f 100644
--- a/tools/marvin/marvin/integration/lib/base/SecurityGroupEgress.py
+++ b/tools/marvin/marvin/integration/lib/base/SecurityGroupEgress.py
@@ -18,11 +18,11 @@ from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import authorizeSecurityGroupEgress
 from marvin.cloudstackAPI import revokeSecurityGroupEgress
 
-class SecurityGroupEgress(CloudStackEntity):
+class SecurityGroupEgress(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def authorize(self, apiclient, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/SecurityGroupIngress.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SecurityGroupIngress.py b/tools/marvin/marvin/integration/lib/base/SecurityGroupIngress.py
index 4548f0d..492aea6 100644
--- a/tools/marvin/marvin/integration/lib/base/SecurityGroupIngress.py
+++ b/tools/marvin/marvin/integration/lib/base/SecurityGroupIngress.py
@@ -18,11 +18,11 @@ from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import authorizeSecurityGroupIngress
 from marvin.cloudstackAPI import revokeSecurityGroupIngress
 
-class SecurityGroupIngress(CloudStackEntity):
+class SecurityGroupIngress(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def authorize(self, apiclient, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/ServiceForRouter.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ServiceForRouter.py b/tools/marvin/marvin/integration/lib/base/ServiceForRouter.py
index be20600..871f69c 100644
--- a/tools/marvin/marvin/integration/lib/base/ServiceForRouter.py
+++ b/tools/marvin/marvin/integration/lib/base/ServiceForRouter.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import changeServiceForRouter
 
-class ServiceForRouter(CloudStackEntity):
+class ServiceForRouter(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def change(self, apiclient, id, serviceofferingid, **kwargs):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51172782/tools/marvin/marvin/integration/lib/base/ServiceForSystemVm.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ServiceForSystemVm.py b/tools/marvin/marvin/integration/lib/base/ServiceForSystemVm.py
index be0e9fe..0821f8b 100644
--- a/tools/marvin/marvin/integration/lib/base/ServiceForSystemVm.py
+++ b/tools/marvin/marvin/integration/lib/base/ServiceForSystemVm.py
@@ -17,11 +17,11 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import changeServiceForSystemVm
 
-class ServiceForSystemVm(CloudStackEntity):
+class ServiceForSystemVm(CloudStackEntity.CloudStackEntity):
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
+    def __init__(self, **kwargs):
+        self.__dict__.update(**kwargs)
 
 
     def change(self, apiclient, id, serviceofferingid, **kwargs):


[27/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
CLOUDSTACK-1818: make DababaseCreator ready to invoke DatabaseUpgradeChecker, adjust Component startup sequence for integrity checkers
Signed-off-by: Chip Childers <ch...@gmail.com>


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

Branch: refs/heads/marvin_refactor
Commit: 094ffedd7f4b61f646a43cf471e5607765c7068b
Parents: 07a63a8
Author: Kelven Yang <ke...@gmail.com>
Authored: Wed Mar 27 13:08:03 2013 +0000
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:07:53 2013 +0530

----------------------------------------------------------------------
 client/tomcatconf/applicationContext.xml.in        |    2 +-
 server/pom.xml                                     |    2 +-
 server/src/com/cloud/upgrade/DatabaseCreator.java  |   10 ++--
 .../cloud/utils/component/ComponentContext.java    |   32 +++++++-------
 4 files changed, 23 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/094ffedd/client/tomcatconf/applicationContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/applicationContext.xml.in b/client/tomcatconf/applicationContext.xml.in
index 250d5ef..e797f59 100644
--- a/client/tomcatconf/applicationContext.xml.in
+++ b/client/tomcatconf/applicationContext.xml.in
@@ -35,6 +35,7 @@
   <!--
     @DB support
   -->
+  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
   <bean id="transactionContextBuilder" class="com.cloud.utils.db.TransactionContextBuilder" />
   <bean id="actionEventInterceptor" class="com.cloud.event.ActionEventInterceptor" />
 
@@ -680,7 +681,6 @@
   <bean id="bAREMETAL" class="org.apache.cloudstack.storage.image.format.BAREMETAL" />
   <bean id="cloudOrchestrator" class="org.apache.cloudstack.platform.orchestration.CloudOrchestrator" />
   <bean id="clusterRestService" class="org.apache.cloudstack.engine.rest.service.api.ClusterRestService" />
-  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
   <bean id="consoleProxyServlet" class="com.cloud.servlet.ConsoleProxyServlet" />
   <bean id="dataCenterResourceManagerImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceManagerImpl" />
   <bean id="dataDisk" class="org.apache.cloudstack.engine.subsystem.api.storage.type.DataDisk" />

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/094ffedd/server/pom.xml
----------------------------------------------------------------------
diff --git a/server/pom.xml b/server/pom.xml
index 1bc0f69..e38cfea 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -110,7 +110,7 @@
           <include>**/*.xml</include>
         </includes>
       </resource>
-    </resources>    
+    </resources>
     <testResources>
       <testResource>
         <directory>test/resources</directory>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/094ffedd/server/src/com/cloud/upgrade/DatabaseCreator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/upgrade/DatabaseCreator.java b/server/src/com/cloud/upgrade/DatabaseCreator.java
index 9b1be6b..d9f9e7b 100755
--- a/server/src/com/cloud/upgrade/DatabaseCreator.java
+++ b/server/src/com/cloud/upgrade/DatabaseCreator.java
@@ -119,11 +119,11 @@ public class DatabaseCreator {
     }
 
     public static void main(String[] args) {
-    	
-    	ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext(
-    	        new String[] {"/com/cloud/upgrade/databaseCreatorContext.xml"});
-    	appContext.getBean(ComponentContext.class);
-    	
+
+	ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext(
+	        new String[] {"/com/cloud/upgrade/databaseCreatorContext.xml"});
+	appContext.getBean(ComponentContext.class);
+
         String dbPropsFile = "";
         List<String> sqlFiles = new ArrayList<String>();
         List<String> upgradeClasses = new ArrayList<String>();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/094ffedd/utils/src/com/cloud/utils/component/ComponentContext.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/component/ComponentContext.java b/utils/src/com/cloud/utils/component/ComponentContext.java
index 32e4464..122eec3 100644
--- a/utils/src/com/cloud/utils/component/ComponentContext.java
+++ b/utils/src/com/cloud/utils/component/ComponentContext.java
@@ -81,6 +81,18 @@ public class ComponentContext implements ApplicationContextAware {
     	for(Map.Entry<String, ComponentLifecycle> entry : lifecyleComponents.entrySet()) {
     		classifiedComponents[entry.getValue().getRunLevel()].put(entry.getKey(), entry.getValue());
     	}
+
+        // Run the SystemIntegrityCheckers first
+        Map<String, SystemIntegrityChecker> integrityCheckers = getApplicationContext().getBeansOfType(SystemIntegrityChecker.class);
+        for (Entry<String,SystemIntegrityChecker> entry : integrityCheckers.entrySet() ){
+            s_logger.info ("Running SystemIntegrityChecker " + entry.getKey());
+            try {
+		entry.getValue().check();
+            } catch(Throwable e) {
+		s_logger.error("System integrity check failed. Refuse to startup");
+		System.exit(1);
+            }
+        }
     	
     	// configuration phase
         Map<String, String> avoidMap = new HashMap<String, String>();
@@ -103,23 +115,11 @@ public class ComponentContext implements ApplicationContextAware {
 				}
                 
                 avoidMap.put(implClassName, implClassName);
-    		}
-    	}
+		}
+	}
 
-        // Run the SystemIntegrityCheckers first
-        Map<String, SystemIntegrityChecker> integrityCheckers = getApplicationContext().getBeansOfType(SystemIntegrityChecker.class);
-        for (Entry<String,SystemIntegrityChecker> entry : integrityCheckers.entrySet() ){
-            s_logger.info ("Running SystemIntegrityChecker " + entry.getKey());
-            try {
-		entry.getValue().check();
-            } catch(Throwable e) {
-		s_logger.error("System integrity check failed. Refuse to startup");
-		System.exit(1);
-            }
-        }
- 
-    	// starting phase
-    	avoidMap.clear();
+	// starting phase
+	avoidMap.clear();
     	for(int i = 0; i < ComponentLifecycle.MAX_RUN_LEVELS; i++) {
     		for(Map.Entry<String, ComponentLifecycle> entry : ((Map<String, ComponentLifecycle>)classifiedComponents[i]).entrySet()) {
     			ComponentLifecycle component = entry.getValue();


[20/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
CLOUDSTACK-452: cloudstack UI - Infrastructure menu - zone detail - guest network - add guest network - validation - Either IPv4 fields or IPv6 fields need to be filled when adding a guest network.


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

Branch: refs/heads/marvin_refactor
Commit: 48cd9cc77ee688abe7f809af9a5b992a5e3a1af4
Parents: 70566dd
Author: Jessica Wang <je...@citrix.com>
Authored: Tue Mar 26 16:35:10 2013 -0700
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:05:19 2013 +0530

----------------------------------------------------------------------
 ui/scripts/system.js |  400 ++-------------------------------------------
 1 files changed, 14 insertions(+), 386 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/48cd9cc7/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 9d6c476..31aef8f 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -1350,7 +1350,7 @@
 															  var $form = $(this).closest("form");
 																var selectedNetworkOfferingId = $(this).val();
 																$(networkOfferingObjs).each(function(){
-																  if(this.id == selectedNetworkOfferingId) {																		
+																  if(this.id == selectedNetworkOfferingId) {
 																		if(this.specifyvlan == false) {
 																		  $form.find('.form-item[rel=vlanId]').hide();
 																			cloudStack.dialog.createFormField.validation.required.remove($form.find('.form-item[rel=vlanId]'));	//make vlanId optional 	 	
@@ -1376,11 +1376,11 @@
                             docID: 'helpGuestNetworkZoneNetmask'
                           },
                           startipv4: { 
-							label: 'IPv4 Start IP', 							
+							label: 'IPv4 Start IP',
                             docID: 'helpGuestNetworkZoneStartIP'
 						  },
                           endipv4: { 
-							label: 'IPv4 End IP', 							
+							label: 'IPv4 End IP',
                             docID: 'helpGuestNetworkZoneEndIP'
 						  },
 						//IPv4 (end)
@@ -1394,11 +1394,11 @@
                             label: 'IPv6 CIDR'
                           },
                           startipv6: { 
-							label: 'IPv6 Start IP', 							
+							label: 'IPv6 Start IP',
                             docID: 'helpGuestNetworkZoneStartIP'
 						  },
                           endipv6: { 
-							label: 'IPv6 End IP', 							
+							label: 'IPv6 End IP',
                             docID: 'helpGuestNetworkZoneEndIP'
 						  },
 						//IPv6 (end)
@@ -1410,17 +1410,17 @@
                         }
                       },
 
-                      action: function(args) { //Add guest network in advanced zone											  
+                      action: function(args) { //Add guest network in advanced zone
 												if (
 													((args.data.ip4gateway.length == 0) && (args.data.ip4Netmask.length == 0) && (args.data.startipv4.length == 0) && (args.data.endipv4.length == 0))
-													&& 
+													&&
 													((args.data.ip6gateway.length == 0) && (args.data.ip6cidr.length == 0) && (args.data.startipv6.length == 0) && (args.data.endipv6.length == 0))
 												)
 												{
 												  args.response.error("Either IPv4 fields or IPv6 fields need to be filled when adding a guest network");
 													return;
 												}
-											
+
                         var $form = args.$form;
 
 												var array1 = [];
@@ -1481,13 +1481,13 @@
 												
 												//IPv6 (begin)
 											    if(args.data.ip6gateway != null && args.data.ip6gateway.length > 0)
-												  array1.push("&ip6gateway=" + args.data.ip6gateway);
+												  array1.push("&gateway=" + args.data.ip6gateway);
 												if(args.data.ip6cidr != null && args.data.ip6cidr.length > 0)
-												  array1.push("&ip6cidr=" + args.data.ip6cidr);
+												  array1.push("&netmask=" + args.data.ip6cidr);
 												if(($form.find('.form-item[rel=startipv6]').css("display") != "none") && (args.data.startipv6 != null && args.data.startipv6.length > 0))
-												  array1.push("&startipv6=" + args.data.startipv6);
+												  array1.push("&startip=" + args.data.startipv6);
 												if(($form.find('.form-item[rel=endipv6]').css("display") != "none") && (args.data.endipv6 != null && args.data.endipv6.length > 0))
-												  array1.push("&endipv6=" + args.data.endipv6);
+												  array1.push("&endip=" + args.data.endipv6);
 												//IPv6 (end)
 												
 												if(args.data.networkdomain != null && args.data.networkdomain.length > 0)
@@ -4109,199 +4109,6 @@
                 notification: { poll: pollAsyncJobResult }
               }
             }
-          },
-          // BigSwitch Vns provider detail view
-          bigswitchVns: {
-            type: 'detailView',
-            id: 'bigswitchVnsProvider',
-            label: 'label.bigswitchVns',
-            viewAll: { label: 'label.devices', path: '_zone.bigswitchVnsDevices' },
-            tabs: {
-              details: {
-                title: 'label.details',
-                fields: [
-                  {
-                    name: { label: 'label.name' }
-                  },
-                  {
-                    state: { label: 'label.state' }
-                  }
-                ],
-                dataProvider: function(args) {
-                  refreshNspData("BigSwitchVns");
-                  var providerObj;
-                  $(nspHardcodingArray).each(function(){
-                    if(this.id == "bigswitchVns") {
-                      providerObj = this;
-                      return false;
-                    }
-                  });
-                  args.response.success({
-                    data: providerObj,
-                    actionFilter: networkProviderActionFilter('bigswitchVns')
-                  });
-                }
-              }
-            },
-            actions: {
-              add: {
-                label: 'label.add.BigSwitchVns.device',
-                createForm: {
-                  title: 'label.add.BigSwitchVns.device',
-                  preFilter: function(args) {  },
-                  fields: {
-                    host: {
-                      label: 'label.ip.address'
-                    },
-                    numretries: {
-                      label: 'label.numretries',
-                      defaultValue: '2'
-                    },
-                  }
-                },
-                action: function(args) {
-                  if(nspMap["bigswitchVns"] == null) {
-                    $.ajax({
-                      url: createURL("addNetworkServiceProvider&name=BigSwitchVns&physicalnetworkid=" + selectedPhysicalNetworkObj.id),
-                      dataType: "json",
-                      async: true,
-                      success: function(json) {
-                        var jobId = json.addnetworkserviceproviderresponse.jobid;
-                        var addBigSwitchVnsProviderIntervalID = setInterval(function() {
-                          $.ajax({
-                            url: createURL("queryAsyncJobResult&jobId="+jobId),
-                            dataType: "json",
-                            success: function(json) {
-                              var result = json.queryasyncjobresultresponse;
-                              if (result.jobstatus == 0) {
-                                return; //Job has not completed
-                              }
-                              else {
-                                clearInterval(addBigSwitchVnsProviderIntervalID);
-                                if (result.jobstatus == 1) {
-                                  nspMap["bigswitchVns"] = json.queryasyncjobresultresponse.jobresult.networkserviceprovider;
-                                  addBigSwitchVnsDevice(args, selectedPhysicalNetworkObj, "addBigSwitchVnsDevice", "addbigswitchvnsdeviceresponse", "bigswitchvnsdevice")
-                                }
-                                else if (result.jobstatus == 2) {
-                                  alert("addNetworkServiceProvider&name=BigSwitchVns failed. Error: " + _s(result.jobresult.errortext));
-                                }
-                              }
-                            },
-                            error: function(XMLHttpResponse) {
-                              var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
-                              alert("addNetworkServiceProvider&name=BigSwitchVns failed. Error: " + errorMsg);
-                            }
-                          });
-                        }, 3000);
-                      }
-                    });
-                  }
-                  else {
-                    addBigSwitchVnsDevice(args, selectedPhysicalNetworkObj, "addBigSwitchVnsDevice", "addbigswitchvnsdeviceresponse", "bigswitchvnsdevice")
-                  }
-                },
-                messages: {
-                  notification: function(args) {
-                    return 'label.add.BigSwitchVns.device';
-                  }
-                },
-                notification: {
-                  poll: pollAsyncJobResult
-                }
-              },
-              enable: {
-                label: 'label.enable.provider',
-                action: function(args) {
-                  $.ajax({
-                    url: createURL("updateNetworkServiceProvider&id=" + nspMap["bigswitchVns"].id + "&state=Enabled"),
-                    dataType: "json",
-                    success: function(json) {
-                      var jid = json.updatenetworkserviceproviderresponse.jobid;
-                      args.response.success(
-                        {_custom:
-                          {
-                            jobId: jid,
-                            getUpdatedItem: function(json) {
-                              $(window).trigger('cloudStack.fullRefresh');
-                            }
-                          }
-                        }
-                      );
-                    }
-                  });
-                },
-                messages: {
-                  confirm: function(args) {
-                    return 'message.confirm.enable.provider';
-                  },
-                  notification: function() {
-                    return 'label.enable.provider';
-                  }
-                },
-                notification: { poll: pollAsyncJobResult }
-              },
-              disable: {
-                label: 'label.disable.provider',
-                action: function(args) {
-                  $.ajax({
-                    url: createURL("updateNetworkServiceProvider&id=" + nspMap["bigswitchVns"].id + "&state=Disabled"),
-                    dataType: "json",
-                    success: function(json) {
-                      var jid = json.updatenetworkserviceproviderresponse.jobid;
-                      args.response.success(
-                        {_custom:
-                          {
-                            jobId: jid,
-                            getUpdatedItem: function(json) {
-                              $(window).trigger('cloudStack.fullRefresh');
-                            }
-                          }
-                        }
-                      );
-                    }
-                  });
-                },
-                messages: {
-                  confirm: function(args) {
-                    return 'message.confirm.disable.provider';
-                  },
-                  notification: function() {
-                    return 'label.disable.provider';
-                  }
-                },
-                notification: { poll: pollAsyncJobResult }
-              },
-              destroy: {
-                label: 'label.shutdown.provider',
-                action: function(args) {
-                  $.ajax({
-                    url: createURL("deleteNetworkServiceProvider&id=" + nspMap["bigswitchVns"].id),
-                    dataType: "json",
-                    success: function(json) {
-                      var jid = json.deletenetworkserviceproviderresponse.jobid;
-                      args.response.success(
-                        {_custom:
-                         {
-                           jobId: jid
-                         }
-                        }
-                      );
-
-                      $(window).trigger('cloudStack.fullRefresh');
-                    }
-                  });
-                },
-                messages: {
-                  confirm: function(args) {
-                    return 'message.confirm.shutdown.provider';
-                  },
-                  notification: function(args) {
-                    return 'label.shutdown.provider';
-                  }
-                },
-                notification: { poll: pollAsyncJobResult }
-              }
-            }
           }          
         }
       }
@@ -7107,152 +6914,6 @@
           }
         }
       },
-      bigswitchVnsDevices: {
-        id: 'bigswitchVnsDevices',
-        title: 'label.devices',
-        listView: {
-          id: 'bigswitchVnsDevices',
-          fields: {
-            hostname: { label: 'label.bigswitch.controller.address' },
-          },
-          actions: {
-              add: {
-                label: 'label.add.BigSwitchVns.device',
-                createForm: {
-                  title: 'label.add.BigSwitchVns.device',
-                  preFilter: function(args) {  },
-                  fields: {
-                    host: {
-                      label: 'label.ip.address'
-                    },
-                    numretries: {
-                      label: 'label.numretries',
-                      defaultValue: '2'
-                    },
-                  }
-                },
-                action: function(args) {
-                  if(nspMap["bigswitchVns"] == null) {
-                    $.ajax({
-                      url: createURL("addNetworkServiceProvider&name=BigSwitchVns&physicalnetworkid=" + selectedPhysicalNetworkObj.id),
-                      dataType: "json",
-                      async: true,
-                      success: function(json) {
-                        var jobId = json.addnetworkserviceproviderresponse.jobid;
-                        var addBigSwitchVnsProviderIntervalID = setInterval(function() {
-                          $.ajax({
-                            url: createURL("queryAsyncJobResult&jobId="+jobId),
-                            dataType: "json",
-                            success: function(json) {
-                              var result = json.queryasyncjobresultresponse;
-                              if (result.jobstatus == 0) {
-                                return;
-                              }
-                              else {
-                                clearInterval(addBigSwitchVnsProviderIntervalID);
-                                if (result.jobstatus == 1) {
-                                  nspMap["bigswitchVns"] = json.queryasyncjobresultresponse.jobresult.networkserviceprovider;
-                                  addBigSwitchVnsDevice(args, selectedPhysicalNetworkObj, "addBigSwitchVnsDevice", "addbigswitchvnsdeviceresponse", "bigswitchvnsdevice")
-                                }
-                                else if (result.jobstatus == 2) {
-                                  alert("addNetworkServiceProvider&name=BigSwitchVns failed. Error: " + _s(result.jobresult.errortext));
-                                }
-                              }
-                            },
-                            error: function(XMLHttpResponse) {
-                              var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
-                              alert("addNetworkServiceProvider&name=BigSwitchVns failed. Error: " + errorMsg);
-                            }
-                          });
-                        }, 3000);
-                      }
-                    });
-                  }
-                  else {
-                      addBigSwitchVnsDevice(args, selectedPhysicalNetworkObj, "addBigSwitchVnsDevice", "addbigswitchvnsdeviceresponse", "bigswitchvnsdevice")
-                  }
-                },
-
-              messages: {
-                notification: function(args) {
-                  return 'Added new BigSwitch Vns Controller';
-                }
-              },
-              notification: {
-                poll: pollAsyncJobResult
-              }
-            }
-          },
-          dataProvider: function(args) {
-            $.ajax({
-              url: createURL("listBigSwitchVnsDevices&physicalnetworkid=" + selectedPhysicalNetworkObj.id),
-              data: { page: args.page, pageSize: pageSize },
-              dataType: "json",
-              async: false,
-              success: function(json) {
-                var items = json.listbigswitchvnsdeviceresponse.bigswitchvnsdevice;
-                args.response.success({data: items});
-              }
-            });
-          },
-          detailView: {
-            name: 'BigSwitch Vns details',
-            actions: {
-              'remove': {
-                label: 'label.delete.BigSwitchVns',
-                messages: {
-                  confirm: function(args) {
-                    return 'message.confirm.delete.BigSwitchVns';
-                  },
-                  notification: function(args) {
-                    return 'label.delete.BigSwitchVns';
-                  }
-                },
-                action: function(args) {
-                  $.ajax({
-                    url: createURL("deleteBigSwitchVnsDevice&vnsdeviceid=" + args.context.bigswitchvnsDevices[0].vnsdeviceid),
-                    dataType: "json",
-                    async: true,
-                    success: function(json) {
-                      var jid = json.deletebigswitchvnsdeviceresponse.jobid;
-                      args.response.success(
-                        {_custom:
-                         {jobId: jid}
-                        }
-                      );
-                    }
-                  });
-                },
-                notification: {
-                  poll: pollAsyncJobResult
-                }
-              }
-            },
-            tabs: {
-              details: {
-                title: 'label.details',
-                fields: [
-                  {
-                    vnsdeviceid: { label: 'label.id' },
-                    hostname: { label: 'label.ip.address' },
-                  }
-                ],
-                dataProvider: function(args) {
-                    $.ajax({
-                        url: createURL("listBigSwitchVnsDevices&vnsdeviceid=" + args.context.bigswitchVnsDevices[0].vnsdeviceid),
-                        dataType: "json",
-                        async: true,
-                        success: function(json) {
-                            var item = json.listbigswitchvnsdeviceresponse.bigswitchvnsdevice[0];
-                            args.response.success({data: item});
-                        }
-                    });
-                }
-              }
-            }
-          }
-        }
-      },
       pods: {
         title: 'label.pods',
         listView: {
@@ -9918,8 +9579,7 @@
                   url: createURL("createStoragePool" + array1.join("")),
                   dataType: "json",
                   success: function(json) {
-                    var item = json.createstoragepoolresponse.storagepool;
-                    
+                    var item = json.createstoragepoolresponse.storagepool[0];
                     args.response.success({
 										  data: item
 										});
@@ -10736,30 +10396,6 @@
     });
   }
 
-  function addBigSwitchVnsDevice(args, physicalNetworkObj, apiCmd, apiCmdRes, apiCmdObj) {
-    var array1 = [];
-    array1.push("&physicalnetworkid=" + physicalNetworkObj.id);
-    array1.push("&hostname=" + todb(args.data.host));
-
-    $.ajax({
-      url: createURL(apiCmd + array1.join("")),
-      dataType: "json",
-      success: function(json) {
-        var jid = json[apiCmdRes].jobid;
-        args.response.success(
-          {_custom:
-           {jobId: jid,
-            getUpdatedItem: function(json) {
-              var item = json.queryasyncjobresultresponse.jobresult[apiCmdObj];
-
-              return item;
-            }
-           }
-          }
-        );
-      }
-    });
-  }
 
 	var afterCreateZonePhysicalNetworkTrafficTypes = function(args, newZoneObj, newPhysicalnetwork) {
 		$.ajax({
@@ -11345,9 +10981,6 @@
                             case "NiciraNvp":
                                 nspMap["niciraNvp"] = items[i];
                                 break;
-                                                        case "BigSwitchVns":
-                                                                nspMap["bigswitchVns"] = items[i];
-                                                                break;
 						}
 					}
 				}
@@ -11369,12 +11002,7 @@
                 id: 'niciraNvp',
                 name: 'Nicira Nvp',
                 state: nspMap.niciraNvp ? nspMap.niciraNvp.state : 'Disabled'
-            },
-                        {
-                                id: 'bigswitchVns',
-                                name: 'BigSwitch Vns',
-                                state: nspMap.bigswitchVns ? nspMap.bigswitchVns.state : 'Disabled'
-                        }
+            }
 		];
 
 		if(selectedZoneObj.networktype == "Basic") {


[42/50] [abbrv] actions on entity object require id for performing the action

Posted by ts...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/NetworkDevice.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/NetworkDevice.py b/tools/marvin/marvin/integration/lib/base/NetworkDevice.py
index 7cfca15..b81922e 100644
--- a/tools/marvin/marvin/integration/lib/base/NetworkDevice.py
+++ b/tools/marvin/marvin/integration/lib/base/NetworkDevice.py
@@ -28,21 +28,25 @@ class NetworkDevice(CloudStackEntity.CloudStackEntity):
 
     def add(self, apiclient, **kwargs):
         cmd = addNetworkDevice.addNetworkDeviceCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         networkdevice = apiclient.addNetworkDevice(cmd)
+        return networkdevice
 
 
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listNetworkDevice.listNetworkDeviceCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         networkdevice = apiclient.listNetworkDevice(cmd)
         return map(lambda e: NetworkDevice(e.__dict__), networkdevice)
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteNetworkDevice.deleteNetworkDeviceCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         networkdevice = apiclient.deleteNetworkDevice(cmd)
+        return networkdevice
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/NetworkOffering.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/NetworkOffering.py b/tools/marvin/marvin/integration/lib/base/NetworkOffering.py
index 741ef81..2566989 100644
--- a/tools/marvin/marvin/integration/lib/base/NetworkOffering.py
+++ b/tools/marvin/marvin/integration/lib/base/NetworkOffering.py
@@ -39,20 +39,24 @@ class NetworkOffering(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listNetworkOfferings.listNetworkOfferingsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         networkoffering = apiclient.listNetworkOfferings(cmd)
         return map(lambda e: NetworkOffering(e.__dict__), networkoffering)
 
 
     def update(self, apiclient, **kwargs):
         cmd = updateNetworkOffering.updateNetworkOfferingCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         networkoffering = apiclient.updateNetworkOffering(cmd)
+        return networkoffering
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteNetworkOffering.deleteNetworkOfferingCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         networkoffering = apiclient.deleteNetworkOffering(cmd)
+        return networkoffering
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/NetworkServiceProvider.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/NetworkServiceProvider.py b/tools/marvin/marvin/integration/lib/base/NetworkServiceProvider.py
index 604d33a..150f62a 100644
--- a/tools/marvin/marvin/integration/lib/base/NetworkServiceProvider.py
+++ b/tools/marvin/marvin/integration/lib/base/NetworkServiceProvider.py
@@ -29,30 +29,36 @@ class NetworkServiceProvider(CloudStackEntity.CloudStackEntity):
 
     def add(self, apiclient, physicalnetworkid, name, **kwargs):
         cmd = addNetworkServiceProvider.addNetworkServiceProviderCmd()
+        cmd.id = self.id
         cmd.name = name
         cmd.physicalnetworkid = physicalnetworkid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         networkserviceprovider = apiclient.addNetworkServiceProvider(cmd)
+        return networkserviceprovider
 
 
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listNetworkServiceProviders.listNetworkServiceProvidersCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         networkserviceprovider = apiclient.listNetworkServiceProviders(cmd)
         return map(lambda e: NetworkServiceProvider(e.__dict__), networkserviceprovider)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateNetworkServiceProvider.updateNetworkServiceProviderCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         networkserviceprovider = apiclient.updateNetworkServiceProvider(cmd)
+        return networkserviceprovider
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteNetworkServiceProvider.deleteNetworkServiceProviderCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         networkserviceprovider = apiclient.deleteNetworkServiceProvider(cmd)
+        return networkserviceprovider
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/NicFromVirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/NicFromVirtualMachine.py b/tools/marvin/marvin/integration/lib/base/NicFromVirtualMachine.py
index 409ac5b..812dcc8 100644
--- a/tools/marvin/marvin/integration/lib/base/NicFromVirtualMachine.py
+++ b/tools/marvin/marvin/integration/lib/base/NicFromVirtualMachine.py
@@ -26,7 +26,10 @@ class NicFromVirtualMachine(CloudStackEntity.CloudStackEntity):
 
     def remove(self, apiclient, nicid, virtualmachineid, **kwargs):
         cmd = removeNicFromVirtualMachine.removeNicFromVirtualMachineCmd()
+        cmd.id = self.id
         cmd.nicid = nicid
         cmd.virtualmachineid = virtualmachineid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         nicfromvirtualmachine = apiclient.removeNicFromVirtualMachine(cmd)
+        return nicfromvirtualmachine
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/NicToVirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/NicToVirtualMachine.py b/tools/marvin/marvin/integration/lib/base/NicToVirtualMachine.py
index e5e501b..00dcb9e 100644
--- a/tools/marvin/marvin/integration/lib/base/NicToVirtualMachine.py
+++ b/tools/marvin/marvin/integration/lib/base/NicToVirtualMachine.py
@@ -26,7 +26,10 @@ class NicToVirtualMachine(CloudStackEntity.CloudStackEntity):
 
     def add(self, apiclient, networkid, virtualmachineid, **kwargs):
         cmd = addNicToVirtualMachine.addNicToVirtualMachineCmd()
+        cmd.id = self.id
         cmd.networkid = networkid
         cmd.virtualmachineid = virtualmachineid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         nictovirtualmachine = apiclient.addNicToVirtualMachine(cmd)
+        return nictovirtualmachine
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/NiciraNvpDevice.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/NiciraNvpDevice.py b/tools/marvin/marvin/integration/lib/base/NiciraNvpDevice.py
index 311bbae..b85ebcb 100644
--- a/tools/marvin/marvin/integration/lib/base/NiciraNvpDevice.py
+++ b/tools/marvin/marvin/integration/lib/base/NiciraNvpDevice.py
@@ -28,26 +28,30 @@ class NiciraNvpDevice(CloudStackEntity.CloudStackEntity):
 
     def add(self, apiclient, username, physicalnetworkid, password, hostname, transportzoneuuid, **kwargs):
         cmd = addNiciraNvpDevice.addNiciraNvpDeviceCmd()
+        cmd.id = self.id
         cmd.hostname = hostname
         cmd.password = password
         cmd.physicalnetworkid = physicalnetworkid
         cmd.transportzoneuuid = transportzoneuuid
         cmd.username = username
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         niciranvpdevice = apiclient.addNiciraNvpDevice(cmd)
+        return niciranvpdevice
 
 
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listNiciraNvpDevices.listNiciraNvpDevicesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         niciranvpdevice = apiclient.listNiciraNvpDevices(cmd)
         return map(lambda e: NiciraNvpDevice(e.__dict__), niciranvpdevice)
 
 
     def delete(self, apiclient, nvpdeviceid, **kwargs):
         cmd = deleteNiciraNvpDevice.deleteNiciraNvpDeviceCmd()
+        cmd.id = self.id
         cmd.nvpdeviceid = nvpdeviceid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         niciranvpdevice = apiclient.deleteNiciraNvpDevice(cmd)
+        return niciranvpdevice
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/NiciraNvpDeviceNetworks.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/NiciraNvpDeviceNetworks.py b/tools/marvin/marvin/integration/lib/base/NiciraNvpDeviceNetworks.py
index 81da82c..0ee75da 100644
--- a/tools/marvin/marvin/integration/lib/base/NiciraNvpDeviceNetworks.py
+++ b/tools/marvin/marvin/integration/lib/base/NiciraNvpDeviceNetworks.py
@@ -28,7 +28,7 @@ class NiciraNvpDeviceNetworks(CloudStackEntity.CloudStackEntity):
     def list(self, apiclient, nvpdeviceid, **kwargs):
         cmd = listNiciraNvpDeviceNetworks.listNiciraNvpDeviceNetworksCmd()
         cmd.nvpdeviceid = nvpdeviceid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         niciranvpdevicenetworks = apiclient.listNiciraNvpDeviceNetworks(cmd)
         return map(lambda e: NiciraNvpDeviceNetworks(e.__dict__), niciranvpdevicenetworks)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Nics.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Nics.py b/tools/marvin/marvin/integration/lib/base/Nics.py
index c121f74..d31efde 100644
--- a/tools/marvin/marvin/integration/lib/base/Nics.py
+++ b/tools/marvin/marvin/integration/lib/base/Nics.py
@@ -28,6 +28,7 @@ class Nics(CloudStackEntity.CloudStackEntity):
     def list(self, apiclient, virtualmachineid, **kwargs):
         cmd = listNics.listNicsCmd()
         cmd.virtualmachineid = virtualmachineid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         nics = apiclient.listNics(cmd)
         return map(lambda e: Nics(e.__dict__), nics)
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/OsCategories.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/OsCategories.py b/tools/marvin/marvin/integration/lib/base/OsCategories.py
index 7926383..7e911fd 100644
--- a/tools/marvin/marvin/integration/lib/base/OsCategories.py
+++ b/tools/marvin/marvin/integration/lib/base/OsCategories.py
@@ -27,7 +27,7 @@ class OsCategories(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listOsCategories.listOsCategoriesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         oscategories = apiclient.listOsCategories(cmd)
         return map(lambda e: OsCategories(e.__dict__), oscategories)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/OsTypes.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/OsTypes.py b/tools/marvin/marvin/integration/lib/base/OsTypes.py
index 5c2c0d6..209366f 100644
--- a/tools/marvin/marvin/integration/lib/base/OsTypes.py
+++ b/tools/marvin/marvin/integration/lib/base/OsTypes.py
@@ -27,7 +27,7 @@ class OsTypes(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listOsTypes.listOsTypesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         ostypes = apiclient.listOsTypes(cmd)
         return map(lambda e: OsTypes(e.__dict__), ostypes)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/PasswordForVirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/PasswordForVirtualMachine.py b/tools/marvin/marvin/integration/lib/base/PasswordForVirtualMachine.py
index 8a6b351..692d6f4 100644
--- a/tools/marvin/marvin/integration/lib/base/PasswordForVirtualMachine.py
+++ b/tools/marvin/marvin/integration/lib/base/PasswordForVirtualMachine.py
@@ -24,13 +24,11 @@ class PasswordForVirtualMachine(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def reset(self, apiclient, id, **kwargs):
         cmd = resetPasswordForVirtualMachine.resetPasswordForVirtualMachineCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         passwordforvirtualmachine = apiclient.resetPasswordForVirtualMachine(cmd)
+        return passwordforvirtualmachine
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/PhysicalNetwork.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/PhysicalNetwork.py b/tools/marvin/marvin/integration/lib/base/PhysicalNetwork.py
index d23f210..f076236 100644
--- a/tools/marvin/marvin/integration/lib/base/PhysicalNetwork.py
+++ b/tools/marvin/marvin/integration/lib/base/PhysicalNetwork.py
@@ -39,21 +39,25 @@ class PhysicalNetwork(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listPhysicalNetworks.listPhysicalNetworksCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         physicalnetwork = apiclient.listPhysicalNetworks(cmd)
         return map(lambda e: PhysicalNetwork(e.__dict__), physicalnetwork)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updatePhysicalNetwork.updatePhysicalNetworkCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         physicalnetwork = apiclient.updatePhysicalNetwork(cmd)
+        return physicalnetwork
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deletePhysicalNetwork.deletePhysicalNetworkCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         physicalnetwork = apiclient.deletePhysicalNetwork(cmd)
+        return physicalnetwork
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Pod.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Pod.py b/tools/marvin/marvin/integration/lib/base/Pod.py
index 811bb82..7258fc4 100644
--- a/tools/marvin/marvin/integration/lib/base/Pod.py
+++ b/tools/marvin/marvin/integration/lib/base/Pod.py
@@ -39,21 +39,25 @@ class Pod(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listPods.listPodsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         pod = apiclient.listPods(cmd)
         return map(lambda e: Pod(e.__dict__), pod)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updatePod.updatePodCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         pod = apiclient.updatePod(cmd)
+        return pod
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deletePod.deletePodCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         pod = apiclient.deletePod(cmd)
+        return pod
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/PortForwardingRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/PortForwardingRule.py b/tools/marvin/marvin/integration/lib/base/PortForwardingRule.py
index a215d7d..c45bada 100644
--- a/tools/marvin/marvin/integration/lib/base/PortForwardingRule.py
+++ b/tools/marvin/marvin/integration/lib/base/PortForwardingRule.py
@@ -39,24 +39,28 @@ class PortForwardingRule(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listPortForwardingRules.listPortForwardingRulesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         portforwardingrule = apiclient.listPortForwardingRules(cmd)
         return map(lambda e: PortForwardingRule(e.__dict__), portforwardingrule)
 
 
     def update(self, apiclient, publicport, protocol, ipaddressid, privateport, **kwargs):
         cmd = updatePortForwardingRule.updatePortForwardingRuleCmd()
+        cmd.id = self.id
         cmd.ipaddressid = ipaddressid
         cmd.privateport = privateport
         cmd.protocol = protocol
         cmd.publicport = publicport
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         portforwardingrule = apiclient.updatePortForwardingRule(cmd)
+        return portforwardingrule
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deletePortForwardingRule.deletePortForwardingRuleCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         portforwardingrule = apiclient.deletePortForwardingRule(cmd)
+        return portforwardingrule
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/PrivateGateway.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/PrivateGateway.py b/tools/marvin/marvin/integration/lib/base/PrivateGateway.py
index c5ccef4..bc4cf01 100644
--- a/tools/marvin/marvin/integration/lib/base/PrivateGateway.py
+++ b/tools/marvin/marvin/integration/lib/base/PrivateGateway.py
@@ -38,14 +38,16 @@ class PrivateGateway(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listPrivateGateways.listPrivateGatewaysCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         privategateway = apiclient.listPrivateGateways(cmd)
         return map(lambda e: PrivateGateway(e.__dict__), privategateway)
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deletePrivateGateway.deletePrivateGatewayCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         privategateway = apiclient.deletePrivateGateway(cmd)
+        return privategateway
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Project.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Project.py b/tools/marvin/marvin/integration/lib/base/Project.py
index 1709a69..dfadbb3 100644
--- a/tools/marvin/marvin/integration/lib/base/Project.py
+++ b/tools/marvin/marvin/integration/lib/base/Project.py
@@ -31,9 +31,11 @@ class Project(CloudStackEntity.CloudStackEntity):
 
     def suspend(self, apiclient, id, **kwargs):
         cmd = suspendProject.suspendProjectCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         project = apiclient.suspendProject(cmd)
+        return project
 
 
     @classmethod
@@ -48,28 +50,34 @@ class Project(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listProjects.listProjectsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         project = apiclient.listProjects(cmd)
         return map(lambda e: Project(e.__dict__), project)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateProject.updateProjectCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         project = apiclient.updateProject(cmd)
+        return project
 
 
     def activate(self, apiclient, id, **kwargs):
         cmd = activateProject.activateProjectCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         project = apiclient.activateProject(cmd)
+        return project
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteProject.deleteProjectCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         project = apiclient.deleteProject(cmd)
+        return project
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/ProjectAccounts.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ProjectAccounts.py b/tools/marvin/marvin/integration/lib/base/ProjectAccounts.py
index 0f1340f..a325130 100644
--- a/tools/marvin/marvin/integration/lib/base/ProjectAccounts.py
+++ b/tools/marvin/marvin/integration/lib/base/ProjectAccounts.py
@@ -28,7 +28,7 @@ class ProjectAccounts(CloudStackEntity.CloudStackEntity):
     def list(self, apiclient, projectid, **kwargs):
         cmd = listProjectAccounts.listProjectAccountsCmd()
         cmd.projectid = projectid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         projectaccounts = apiclient.listProjectAccounts(cmd)
         return map(lambda e: ProjectAccounts(e.__dict__), projectaccounts)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/ProjectInvitation.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ProjectInvitation.py b/tools/marvin/marvin/integration/lib/base/ProjectInvitation.py
index 8174fef..698dc53 100644
--- a/tools/marvin/marvin/integration/lib/base/ProjectInvitation.py
+++ b/tools/marvin/marvin/integration/lib/base/ProjectInvitation.py
@@ -29,21 +29,25 @@ class ProjectInvitation(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listProjectInvitations.listProjectInvitationsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         projectinvitation = apiclient.listProjectInvitations(cmd)
         return map(lambda e: ProjectInvitation(e.__dict__), projectinvitation)
 
 
     def update(self, apiclient, projectid, **kwargs):
         cmd = updateProjectInvitation.updateProjectInvitationCmd()
+        cmd.id = self.id
         cmd.projectid = projectid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         projectinvitation = apiclient.updateProjectInvitation(cmd)
+        return projectinvitation
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteProjectInvitation.deleteProjectInvitationCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         projectinvitation = apiclient.deleteProjectInvitation(cmd)
+        return projectinvitation
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/PublicIpAddresses.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/PublicIpAddresses.py b/tools/marvin/marvin/integration/lib/base/PublicIpAddresses.py
index 5e1dd67..b6601af 100644
--- a/tools/marvin/marvin/integration/lib/base/PublicIpAddresses.py
+++ b/tools/marvin/marvin/integration/lib/base/PublicIpAddresses.py
@@ -27,7 +27,7 @@ class PublicIpAddresses(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listPublicIpAddresses.listPublicIpAddressesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         publicipaddresses = apiclient.listPublicIpAddresses(cmd)
         return map(lambda e: PublicIpAddresses(e.__dict__), publicipaddresses)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Region.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Region.py b/tools/marvin/marvin/integration/lib/base/Region.py
index cd0a07f..32d21ef 100644
--- a/tools/marvin/marvin/integration/lib/base/Region.py
+++ b/tools/marvin/marvin/integration/lib/base/Region.py
@@ -29,30 +29,37 @@ class Region(CloudStackEntity.CloudStackEntity):
 
     def add(self, apiclient, endpoint, id, name, **kwargs):
         cmd = addRegion.addRegionCmd()
+        cmd.id = self.id
         cmd.id = id
         cmd.endpoint = endpoint
         cmd.name = name
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         region = apiclient.addRegion(cmd)
+        return region
 
 
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listRegions.listRegionsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         region = apiclient.listRegions(cmd)
         return map(lambda e: Region(e.__dict__), region)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateRegion.updateRegionCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         region = apiclient.updateRegion(cmd)
+        return region
 
 
     def remove(self, apiclient, id, **kwargs):
         cmd = removeRegion.removeRegionCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         region = apiclient.removeRegion(cmd)
+        return region
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/RemoteAccessVpn.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/RemoteAccessVpn.py b/tools/marvin/marvin/integration/lib/base/RemoteAccessVpn.py
index a815550..339d706 100644
--- a/tools/marvin/marvin/integration/lib/base/RemoteAccessVpn.py
+++ b/tools/marvin/marvin/integration/lib/base/RemoteAccessVpn.py
@@ -39,14 +39,16 @@ class RemoteAccessVpn(CloudStackEntity.CloudStackEntity):
     def list(self, apiclient, publicipid, **kwargs):
         cmd = listRemoteAccessVpns.listRemoteAccessVpnsCmd()
         cmd.publicipid = publicipid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         remoteaccessvpn = apiclient.listRemoteAccessVpns(cmd)
         return map(lambda e: RemoteAccessVpn(e.__dict__), remoteaccessvpn)
 
 
     def delete(self, apiclient, publicipid, **kwargs):
         cmd = deleteRemoteAccessVpn.deleteRemoteAccessVpnCmd()
+        cmd.id = self.id
         cmd.publicipid = publicipid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         remoteaccessvpn = apiclient.deleteRemoteAccessVpn(cmd)
+        return remoteaccessvpn
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Remove.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Remove.py b/tools/marvin/marvin/integration/lib/base/Remove.py
index 8bf386a..616d94e 100644
--- a/tools/marvin/marvin/integration/lib/base/Remove.py
+++ b/tools/marvin/marvin/integration/lib/base/Remove.py
@@ -26,6 +26,8 @@ class Remove(CloudStackEntity.CloudStackEntity):
 
     def ldap(self, apiclient, **kwargs):
         cmd = ldapRemove.ldapRemoveCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         remove = apiclient.ldapRemove(cmd)
+        return remove
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/ResourceCount.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ResourceCount.py b/tools/marvin/marvin/integration/lib/base/ResourceCount.py
index 9677d2e..dced15d 100644
--- a/tools/marvin/marvin/integration/lib/base/ResourceCount.py
+++ b/tools/marvin/marvin/integration/lib/base/ResourceCount.py
@@ -24,13 +24,11 @@ class ResourceCount(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def update(self, apiclient, domainid, **kwargs):
         cmd = updateResourceCount.updateResourceCountCmd()
+        cmd.id = self.id
         cmd.domainid = domainid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         resourcecount = apiclient.updateResourceCount(cmd)
+        return resourcecount
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/ResourceLimit.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ResourceLimit.py b/tools/marvin/marvin/integration/lib/base/ResourceLimit.py
index 7729aae..bdddadd 100644
--- a/tools/marvin/marvin/integration/lib/base/ResourceLimit.py
+++ b/tools/marvin/marvin/integration/lib/base/ResourceLimit.py
@@ -28,14 +28,16 @@ class ResourceLimit(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listResourceLimits.listResourceLimitsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         resourcelimit = apiclient.listResourceLimits(cmd)
         return map(lambda e: ResourceLimit(e.__dict__), resourcelimit)
 
 
     def update(self, apiclient, resourcetype, **kwargs):
         cmd = updateResourceLimit.updateResourceLimitCmd()
+        cmd.id = self.id
         cmd.resourcetype = resourcetype
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         resourcelimit = apiclient.updateResourceLimit(cmd)
+        return resourcelimit
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Router.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Router.py b/tools/marvin/marvin/integration/lib/base/Router.py
index cca14fd..5b6cd57 100644
--- a/tools/marvin/marvin/integration/lib/base/Router.py
+++ b/tools/marvin/marvin/integration/lib/base/Router.py
@@ -30,36 +30,44 @@ class Router(CloudStackEntity.CloudStackEntity):
 
     def destroy(self, apiclient, id, **kwargs):
         cmd = destroyRouter.destroyRouterCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         router = apiclient.destroyRouter(cmd)
+        return router
 
 
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listRouters.listRoutersCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         router = apiclient.listRouters(cmd)
         return map(lambda e: Router(e.__dict__), router)
 
 
     def stop(self, apiclient, id, **kwargs):
         cmd = stopRouter.stopRouterCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         router = apiclient.stopRouter(cmd)
+        return router
 
 
     def reboot(self, apiclient, id, **kwargs):
         cmd = rebootRouter.rebootRouterCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         router = apiclient.rebootRouter(cmd)
+        return router
 
 
     def start(self, apiclient, id, **kwargs):
         cmd = startRouter.startRouterCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         router = apiclient.startRouter(cmd)
+        return router
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/S3.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/S3.py b/tools/marvin/marvin/integration/lib/base/S3.py
index 39e59f6..ce1d65a 100644
--- a/tools/marvin/marvin/integration/lib/base/S3.py
+++ b/tools/marvin/marvin/integration/lib/base/S3.py
@@ -27,17 +27,19 @@ class S3(CloudStackEntity.CloudStackEntity):
 
     def add(self, apiclient, secretkey, accesskey, bucket, **kwargs):
         cmd = addS3.addS3Cmd()
+        cmd.id = self.id
         cmd.accesskey = accesskey
         cmd.bucket = bucket
         cmd.secretkey = secretkey
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         s3 = apiclient.addS3(cmd)
+        return s3
 
 
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listS3s.listS3sCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         s3 = apiclient.listS3s(cmd)
         return map(lambda e: S3(e.__dict__), s3)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/SSHKeyForVirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SSHKeyForVirtualMachine.py b/tools/marvin/marvin/integration/lib/base/SSHKeyForVirtualMachine.py
index ed2f0e9..40e5712 100644
--- a/tools/marvin/marvin/integration/lib/base/SSHKeyForVirtualMachine.py
+++ b/tools/marvin/marvin/integration/lib/base/SSHKeyForVirtualMachine.py
@@ -26,7 +26,10 @@ class SSHKeyForVirtualMachine(CloudStackEntity.CloudStackEntity):
 
     def reset(self, apiclient, keypair, id, **kwargs):
         cmd = resetSSHKeyForVirtualMachine.resetSSHKeyForVirtualMachineCmd()
+        cmd.id = self.id
         cmd.id = id
         cmd.keypair = keypair
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         sshkeyforvirtualmachine = apiclient.resetSSHKeyForVirtualMachine(cmd)
+        return sshkeyforvirtualmachine
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/SSHKeyPair.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SSHKeyPair.py b/tools/marvin/marvin/integration/lib/base/SSHKeyPair.py
index ded6dfb..f080455 100644
--- a/tools/marvin/marvin/integration/lib/base/SSHKeyPair.py
+++ b/tools/marvin/marvin/integration/lib/base/SSHKeyPair.py
@@ -38,23 +38,27 @@ class SSHKeyPair(CloudStackEntity.CloudStackEntity):
 
     def register(self, apiclient, publickey, name, **kwargs):
         cmd = registerSSHKeyPair.registerSSHKeyPairCmd()
+        cmd.id = self.id
         cmd.name = name
         cmd.publickey = publickey
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         sshkeypair = apiclient.registerSSHKeyPair(cmd)
+        return sshkeypair
 
 
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listSSHKeyPairs.listSSHKeyPairsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         sshkeypair = apiclient.listSSHKeyPairs(cmd)
         return map(lambda e: SSHKeyPair(e.__dict__), sshkeypair)
 
 
     def delete(self, apiclient, name, **kwargs):
         cmd = deleteSSHKeyPair.deleteSSHKeyPairCmd()
+        cmd.id = self.id
         cmd.name = name
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         sshkeypair = apiclient.deleteSSHKeyPair(cmd)
+        return sshkeypair
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/SecondaryStorage.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SecondaryStorage.py b/tools/marvin/marvin/integration/lib/base/SecondaryStorage.py
index cc18f41..535d797 100644
--- a/tools/marvin/marvin/integration/lib/base/SecondaryStorage.py
+++ b/tools/marvin/marvin/integration/lib/base/SecondaryStorage.py
@@ -24,13 +24,11 @@ class SecondaryStorage(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def add(self, apiclient, url, **kwargs):
         cmd = addSecondaryStorage.addSecondaryStorageCmd()
+        cmd.id = self.id
         cmd.url = url
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         secondarystorage = apiclient.addSecondaryStorage(cmd)
+        return secondarystorage
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/SecurityGroup.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SecurityGroup.py b/tools/marvin/marvin/integration/lib/base/SecurityGroup.py
index 9ed1007..38e0d4a 100644
--- a/tools/marvin/marvin/integration/lib/base/SecurityGroup.py
+++ b/tools/marvin/marvin/integration/lib/base/SecurityGroup.py
@@ -38,13 +38,15 @@ class SecurityGroup(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listSecurityGroups.listSecurityGroupsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         securitygroup = apiclient.listSecurityGroups(cmd)
         return map(lambda e: SecurityGroup(e.__dict__), securitygroup)
 
 
     def delete(self, apiclient, **kwargs):
         cmd = deleteSecurityGroup.deleteSecurityGroupCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         securitygroup = apiclient.deleteSecurityGroup(cmd)
+        return securitygroup
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/SecurityGroupEgress.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SecurityGroupEgress.py b/tools/marvin/marvin/integration/lib/base/SecurityGroupEgress.py
index 995705c..27dd5e3 100644
--- a/tools/marvin/marvin/integration/lib/base/SecurityGroupEgress.py
+++ b/tools/marvin/marvin/integration/lib/base/SecurityGroupEgress.py
@@ -25,19 +25,19 @@ class SecurityGroupEgress(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def authorize(self, apiclient, **kwargs):
         cmd = authorizeSecurityGroupEgress.authorizeSecurityGroupEgressCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         securitygroupegress = apiclient.authorizeSecurityGroupEgress(cmd)
+        return securitygroupegress
 
 
     def revoke(self, apiclient, id, **kwargs):
         cmd = revokeSecurityGroupEgress.revokeSecurityGroupEgressCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         securitygroupegress = apiclient.revokeSecurityGroupEgress(cmd)
+        return securitygroupegress
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/SecurityGroupIngress.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SecurityGroupIngress.py b/tools/marvin/marvin/integration/lib/base/SecurityGroupIngress.py
index 12e8848..5ada4a4 100644
--- a/tools/marvin/marvin/integration/lib/base/SecurityGroupIngress.py
+++ b/tools/marvin/marvin/integration/lib/base/SecurityGroupIngress.py
@@ -25,19 +25,19 @@ class SecurityGroupIngress(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def authorize(self, apiclient, **kwargs):
         cmd = authorizeSecurityGroupIngress.authorizeSecurityGroupIngressCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         securitygroupingress = apiclient.authorizeSecurityGroupIngress(cmd)
+        return securitygroupingress
 
 
     def revoke(self, apiclient, id, **kwargs):
         cmd = revokeSecurityGroupIngress.revokeSecurityGroupIngressCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         securitygroupingress = apiclient.revokeSecurityGroupIngress(cmd)
+        return securitygroupingress
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/ServiceForRouter.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ServiceForRouter.py b/tools/marvin/marvin/integration/lib/base/ServiceForRouter.py
index 645f035..b11591b 100644
--- a/tools/marvin/marvin/integration/lib/base/ServiceForRouter.py
+++ b/tools/marvin/marvin/integration/lib/base/ServiceForRouter.py
@@ -24,14 +24,12 @@ class ServiceForRouter(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def change(self, apiclient, id, serviceofferingid, **kwargs):
         cmd = changeServiceForRouter.changeServiceForRouterCmd()
+        cmd.id = self.id
         cmd.id = id
         cmd.serviceofferingid = serviceofferingid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         serviceforrouter = apiclient.changeServiceForRouter(cmd)
+        return serviceforrouter
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/ServiceForSystemVm.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ServiceForSystemVm.py b/tools/marvin/marvin/integration/lib/base/ServiceForSystemVm.py
index 0f29f99..51e35c3 100644
--- a/tools/marvin/marvin/integration/lib/base/ServiceForSystemVm.py
+++ b/tools/marvin/marvin/integration/lib/base/ServiceForSystemVm.py
@@ -24,14 +24,12 @@ class ServiceForSystemVm(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def change(self, apiclient, id, serviceofferingid, **kwargs):
         cmd = changeServiceForSystemVm.changeServiceForSystemVmCmd()
+        cmd.id = self.id
         cmd.id = id
         cmd.serviceofferingid = serviceofferingid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         serviceforsystemvm = apiclient.changeServiceForSystemVm(cmd)
+        return serviceforsystemvm
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/ServiceForVirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ServiceForVirtualMachine.py b/tools/marvin/marvin/integration/lib/base/ServiceForVirtualMachine.py
index 0fdf295..ee83788 100644
--- a/tools/marvin/marvin/integration/lib/base/ServiceForVirtualMachine.py
+++ b/tools/marvin/marvin/integration/lib/base/ServiceForVirtualMachine.py
@@ -24,14 +24,12 @@ class ServiceForVirtualMachine(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def change(self, apiclient, id, serviceofferingid, **kwargs):
         cmd = changeServiceForVirtualMachine.changeServiceForVirtualMachineCmd()
+        cmd.id = self.id
         cmd.id = id
         cmd.serviceofferingid = serviceofferingid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         serviceforvirtualmachine = apiclient.changeServiceForVirtualMachine(cmd)
+        return serviceforvirtualmachine
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/ServiceOffering.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ServiceOffering.py b/tools/marvin/marvin/integration/lib/base/ServiceOffering.py
index 04c69fb..1f3c26d 100644
--- a/tools/marvin/marvin/integration/lib/base/ServiceOffering.py
+++ b/tools/marvin/marvin/integration/lib/base/ServiceOffering.py
@@ -39,21 +39,25 @@ class ServiceOffering(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listServiceOfferings.listServiceOfferingsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         serviceoffering = apiclient.listServiceOfferings(cmd)
         return map(lambda e: ServiceOffering(e.__dict__), serviceoffering)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateServiceOffering.updateServiceOfferingCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         serviceoffering = apiclient.updateServiceOffering(cmd)
+        return serviceoffering
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteServiceOffering.deleteServiceOfferingCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         serviceoffering = apiclient.deleteServiceOffering(cmd)
+        return serviceoffering
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Simulator.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Simulator.py b/tools/marvin/marvin/integration/lib/base/Simulator.py
index 41cdcd2..8659dc1 100644
--- a/tools/marvin/marvin/integration/lib/base/Simulator.py
+++ b/tools/marvin/marvin/integration/lib/base/Simulator.py
@@ -26,7 +26,10 @@ class Simulator(CloudStackEntity.CloudStackEntity):
 
     def configure(self, apiclient, name, value, **kwargs):
         cmd = configureSimulator.configureSimulatorCmd()
+        cmd.id = self.id
         cmd.name = name
         cmd.value = value
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         simulator = apiclient.configureSimulator(cmd)
+        return simulator
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Snapshot.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Snapshot.py b/tools/marvin/marvin/integration/lib/base/Snapshot.py
index fac492f..b69228a 100644
--- a/tools/marvin/marvin/integration/lib/base/Snapshot.py
+++ b/tools/marvin/marvin/integration/lib/base/Snapshot.py
@@ -38,14 +38,16 @@ class Snapshot(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listSnapshots.listSnapshotsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         snapshot = apiclient.listSnapshots(cmd)
         return map(lambda e: Snapshot(e.__dict__), snapshot)
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteSnapshot.deleteSnapshotCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         snapshot = apiclient.deleteSnapshot(cmd)
+        return snapshot
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/SnapshotPolicies.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SnapshotPolicies.py b/tools/marvin/marvin/integration/lib/base/SnapshotPolicies.py
index c050225..5daa7cc 100644
--- a/tools/marvin/marvin/integration/lib/base/SnapshotPolicies.py
+++ b/tools/marvin/marvin/integration/lib/base/SnapshotPolicies.py
@@ -29,13 +29,15 @@ class SnapshotPolicies(CloudStackEntity.CloudStackEntity):
     def list(self, apiclient, volumeid, **kwargs):
         cmd = listSnapshotPolicies.listSnapshotPoliciesCmd()
         cmd.volumeid = volumeid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         snapshotpolicies = apiclient.listSnapshotPolicies(cmd)
         return map(lambda e: SnapshotPolicies(e.__dict__), snapshotpolicies)
 
 
     def delete(self, apiclient, **kwargs):
         cmd = deleteSnapshotPolicies.deleteSnapshotPoliciesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         snapshotpolicies = apiclient.deleteSnapshotPolicies(cmd)
+        return snapshotpolicies
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/StaticNat.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/StaticNat.py b/tools/marvin/marvin/integration/lib/base/StaticNat.py
index 87e22f0..3fb5430 100644
--- a/tools/marvin/marvin/integration/lib/base/StaticNat.py
+++ b/tools/marvin/marvin/integration/lib/base/StaticNat.py
@@ -25,21 +25,21 @@ class StaticNat(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def enable(self, apiclient, ipaddressid, virtualmachineid, **kwargs):
         cmd = enableStaticNat.enableStaticNatCmd()
+        cmd.id = self.id
         cmd.ipaddressid = ipaddressid
         cmd.virtualmachineid = virtualmachineid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         staticnat = apiclient.enableStaticNat(cmd)
+        return staticnat
 
 
     def disable(self, apiclient, ipaddressid, **kwargs):
         cmd = disableStaticNat.disableStaticNatCmd()
+        cmd.id = self.id
         cmd.ipaddressid = ipaddressid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         staticnat = apiclient.disableStaticNat(cmd)
+        return staticnat
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/StaticRoute.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/StaticRoute.py b/tools/marvin/marvin/integration/lib/base/StaticRoute.py
index 8e6a08b..5a12907 100644
--- a/tools/marvin/marvin/integration/lib/base/StaticRoute.py
+++ b/tools/marvin/marvin/integration/lib/base/StaticRoute.py
@@ -38,14 +38,16 @@ class StaticRoute(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listStaticRoutes.listStaticRoutesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         staticroute = apiclient.listStaticRoutes(cmd)
         return map(lambda e: StaticRoute(e.__dict__), staticroute)
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteStaticRoute.deleteStaticRouteCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         staticroute = apiclient.deleteStaticRoute(cmd)
+        return staticroute
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/StorageMaintenance.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/StorageMaintenance.py b/tools/marvin/marvin/integration/lib/base/StorageMaintenance.py
index b33a464..09ed406 100644
--- a/tools/marvin/marvin/integration/lib/base/StorageMaintenance.py
+++ b/tools/marvin/marvin/integration/lib/base/StorageMaintenance.py
@@ -25,20 +25,20 @@ class StorageMaintenance(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def cancel(self, apiclient, id, **kwargs):
         cmd = cancelStorageMaintenance.cancelStorageMaintenanceCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         storagemaintenance = apiclient.cancelStorageMaintenance(cmd)
+        return storagemaintenance
 
 
     def enable(self, apiclient, id, **kwargs):
         cmd = enableStorageMaintenance.enableStorageMaintenanceCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         storagemaintenance = apiclient.enableStorageMaintenance(cmd)
+        return storagemaintenance
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/StorageNetworkIpRange.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/StorageNetworkIpRange.py b/tools/marvin/marvin/integration/lib/base/StorageNetworkIpRange.py
index e431662..c29b348 100644
--- a/tools/marvin/marvin/integration/lib/base/StorageNetworkIpRange.py
+++ b/tools/marvin/marvin/integration/lib/base/StorageNetworkIpRange.py
@@ -39,21 +39,25 @@ class StorageNetworkIpRange(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listStorageNetworkIpRange.listStorageNetworkIpRangeCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         storagenetworkiprange = apiclient.listStorageNetworkIpRange(cmd)
         return map(lambda e: StorageNetworkIpRange(e.__dict__), storagenetworkiprange)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateStorageNetworkIpRange.updateStorageNetworkIpRangeCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         storagenetworkiprange = apiclient.updateStorageNetworkIpRange(cmd)
+        return storagenetworkiprange
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteStorageNetworkIpRange.deleteStorageNetworkIpRangeCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         storagenetworkiprange = apiclient.deleteStorageNetworkIpRange(cmd)
+        return storagenetworkiprange
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/StoragePool.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/StoragePool.py b/tools/marvin/marvin/integration/lib/base/StoragePool.py
index f8000b5..91fd261 100644
--- a/tools/marvin/marvin/integration/lib/base/StoragePool.py
+++ b/tools/marvin/marvin/integration/lib/base/StoragePool.py
@@ -39,21 +39,25 @@ class StoragePool(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listStoragePools.listStoragePoolsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         storagepool = apiclient.listStoragePools(cmd)
         return map(lambda e: StoragePool(e.__dict__), storagepool)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateStoragePool.updateStoragePoolCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         storagepool = apiclient.updateStoragePool(cmd)
+        return storagepool
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteStoragePool.deleteStoragePoolCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         storagepool = apiclient.deleteStoragePool(cmd)
+        return storagepool
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/StorageProviders.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/StorageProviders.py b/tools/marvin/marvin/integration/lib/base/StorageProviders.py
new file mode 100644
index 0000000..406282f
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/base/StorageProviders.py
@@ -0,0 +1,33 @@
+# 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.
+from marvin.integration.lib.base import CloudStackEntity
+from marvin.cloudstackAPI import listStorageProviders
+
+class StorageProviders(CloudStackEntity.CloudStackEntity):
+
+
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
+    @classmethod
+    def list(self, apiclient, type, **kwargs):
+        cmd = listStorageProviders.listStorageProvidersCmd()
+        cmd.type = type
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        storageproviders = apiclient.listStorageProviders(cmd)
+        return map(lambda e: StorageProviders(e.__dict__), storageproviders)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/SupportedNetworkServices.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SupportedNetworkServices.py b/tools/marvin/marvin/integration/lib/base/SupportedNetworkServices.py
index 02d0530..081aa6f 100644
--- a/tools/marvin/marvin/integration/lib/base/SupportedNetworkServices.py
+++ b/tools/marvin/marvin/integration/lib/base/SupportedNetworkServices.py
@@ -27,7 +27,7 @@ class SupportedNetworkServices(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listSupportedNetworkServices.listSupportedNetworkServicesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         supportednetworkservices = apiclient.listSupportedNetworkServices(cmd)
         return map(lambda e: SupportedNetworkServices(e.__dict__), supportednetworkservices)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Swift.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Swift.py b/tools/marvin/marvin/integration/lib/base/Swift.py
index ab3dec3..0a02280 100644
--- a/tools/marvin/marvin/integration/lib/base/Swift.py
+++ b/tools/marvin/marvin/integration/lib/base/Swift.py
@@ -27,15 +27,17 @@ class Swift(CloudStackEntity.CloudStackEntity):
 
     def add(self, apiclient, url, **kwargs):
         cmd = addSwift.addSwiftCmd()
+        cmd.id = self.id
         cmd.url = url
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         swift = apiclient.addSwift(cmd)
+        return swift
 
 
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listSwifts.listSwiftsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         swift = apiclient.listSwifts(cmd)
         return map(lambda e: Swift(e.__dict__), swift)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/SystemVm.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SystemVm.py b/tools/marvin/marvin/integration/lib/base/SystemVm.py
index 8e51acc..657e4df 100644
--- a/tools/marvin/marvin/integration/lib/base/SystemVm.py
+++ b/tools/marvin/marvin/integration/lib/base/SystemVm.py
@@ -31,44 +31,54 @@ class SystemVm(CloudStackEntity.CloudStackEntity):
 
     def migrate(self, apiclient, hostid, virtualmachineid, **kwargs):
         cmd = migrateSystemVm.migrateSystemVmCmd()
+        cmd.id = self.id
         cmd.hostid = hostid
         cmd.virtualmachineid = virtualmachineid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         systemvm = apiclient.migrateSystemVm(cmd)
+        return systemvm
 
 
     def stop(self, apiclient, id, **kwargs):
         cmd = stopSystemVm.stopSystemVmCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         systemvm = apiclient.stopSystemVm(cmd)
+        return systemvm
 
 
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listSystemVms.listSystemVmsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         systemvm = apiclient.listSystemVms(cmd)
         return map(lambda e: SystemVm(e.__dict__), systemvm)
 
 
     def reboot(self, apiclient, id, **kwargs):
         cmd = rebootSystemVm.rebootSystemVmCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         systemvm = apiclient.rebootSystemVm(cmd)
+        return systemvm
 
 
     def start(self, apiclient, id, **kwargs):
         cmd = startSystemVm.startSystemVmCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         systemvm = apiclient.startSystemVm(cmd)
+        return systemvm
 
 
     def destroy(self, apiclient, id, **kwargs):
         cmd = destroySystemVm.destroySystemVmCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         systemvm = apiclient.destroySystemVm(cmd)
+        return systemvm
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Tags.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Tags.py b/tools/marvin/marvin/integration/lib/base/Tags.py
index e044a41..24ba720 100644
--- a/tools/marvin/marvin/integration/lib/base/Tags.py
+++ b/tools/marvin/marvin/integration/lib/base/Tags.py
@@ -38,15 +38,17 @@ class Tags(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listTags.listTagsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         tags = apiclient.listTags(cmd)
         return map(lambda e: Tags(e.__dict__), tags)
 
 
     def delete(self, apiclient, resourcetype, resourceids, **kwargs):
         cmd = deleteTags.deleteTagsCmd()
+        cmd.id = self.id
         cmd.resourceids = resourceids
         cmd.resourcetype = resourcetype
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         tags = apiclient.deleteTags(cmd)
+        return tags
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Template.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Template.py b/tools/marvin/marvin/integration/lib/base/Template.py
index e839c14..ec74d30 100644
--- a/tools/marvin/marvin/integration/lib/base/Template.py
+++ b/tools/marvin/marvin/integration/lib/base/Template.py
@@ -33,10 +33,12 @@ class Template(CloudStackEntity.CloudStackEntity):
 
     def prepare(self, apiclient, zoneid, templateid, **kwargs):
         cmd = prepareTemplate.prepareTemplateCmd()
+        cmd.id = self.id
         cmd.templateid = templateid
         cmd.zoneid = zoneid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         template = apiclient.prepareTemplate(cmd)
+        return template
 
 
     @classmethod
@@ -50,6 +52,7 @@ class Template(CloudStackEntity.CloudStackEntity):
 
     def register(self, apiclient, name, format, url, hypervisor, zoneid, displaytext, ostypeid, **kwargs):
         cmd = registerTemplate.registerTemplateCmd()
+        cmd.id = self.id
         cmd.displaytext = displaytext
         cmd.format = format
         cmd.hypervisor = hypervisor
@@ -57,46 +60,55 @@ class Template(CloudStackEntity.CloudStackEntity):
         cmd.ostypeid = ostypeid
         cmd.url = url
         cmd.zoneid = zoneid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         template = apiclient.registerTemplate(cmd)
+        return template
 
 
     @classmethod
     def list(self, apiclient, templatefilter, **kwargs):
         cmd = listTemplates.listTemplatesCmd()
         cmd.templatefilter = templatefilter
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         template = apiclient.listTemplates(cmd)
         return map(lambda e: Template(e.__dict__), template)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateTemplate.updateTemplateCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         template = apiclient.updateTemplate(cmd)
+        return template
 
 
     def copy(self, apiclient, sourcezoneid, id, destzoneid, **kwargs):
         cmd = copyTemplate.copyTemplateCmd()
+        cmd.id = self.id
         cmd.id = id
         cmd.destzoneid = destzoneid
         cmd.sourcezoneid = sourcezoneid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         template = apiclient.copyTemplate(cmd)
+        return template
 
 
     def extract(self, apiclient, id, mode, **kwargs):
         cmd = extractTemplate.extractTemplateCmd()
+        cmd.id = self.id
         cmd.id = id
         cmd.mode = mode
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         template = apiclient.extractTemplate(cmd)
+        return template
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteTemplate.deleteTemplateCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         template = apiclient.deleteTemplate(cmd)
+        return template
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/TemplatePermissions.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/TemplatePermissions.py b/tools/marvin/marvin/integration/lib/base/TemplatePermissions.py
index 0fc4401..56f3b20 100644
--- a/tools/marvin/marvin/integration/lib/base/TemplatePermissions.py
+++ b/tools/marvin/marvin/integration/lib/base/TemplatePermissions.py
@@ -29,14 +29,16 @@ class TemplatePermissions(CloudStackEntity.CloudStackEntity):
     def list(self, apiclient, id, **kwargs):
         cmd = listTemplatePermissions.listTemplatePermissionsCmd()
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         templatepermissions = apiclient.listTemplatePermissions(cmd)
         return map(lambda e: TemplatePermissions(e.__dict__), templatepermissions)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateTemplatePermissions.updateTemplatePermissionsCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         templatepermissions = apiclient.updateTemplatePermissions(cmd)
+        return templatepermissions
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/ToGlobalLoadBalancerRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ToGlobalLoadBalancerRule.py b/tools/marvin/marvin/integration/lib/base/ToGlobalLoadBalancerRule.py
new file mode 100644
index 0000000..e5a2ede
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/base/ToGlobalLoadBalancerRule.py
@@ -0,0 +1,34 @@
+# 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.
+from marvin.integration.lib.base import CloudStackEntity
+from marvin.cloudstackAPI import assignToGlobalLoadBalancerRule
+
+class ToGlobalLoadBalancerRule(CloudStackEntity.CloudStackEntity):
+
+
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
+    def assign(self, apiclient, loadbalancerrulelist, id, **kwargs):
+        cmd = assignToGlobalLoadBalancerRule.assignToGlobalLoadBalancerRuleCmd()
+        cmd.id = self.id
+        cmd.id = id
+        cmd.loadbalancerrulelist = loadbalancerrulelist
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        togloballoadbalancerrule = apiclient.assignToGlobalLoadBalancerRule(cmd)
+        return togloballoadbalancerrule

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py b/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py
index 6cd2b3d..552c9ac 100644
--- a/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py
+++ b/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py
@@ -24,14 +24,12 @@ class ToLoadBalancerRule(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def assign(self, apiclient, id, virtualmachineids, **kwargs):
         cmd = assignToLoadBalancerRule.assignToLoadBalancerRuleCmd()
+        cmd.id = self.id
         cmd.id = id
         cmd.virtualmachineids = virtualmachineids
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         toloadbalancerrule = apiclient.assignToLoadBalancerRule(cmd)
+        return toloadbalancerrule
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/TrafficMonitor.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/TrafficMonitor.py b/tools/marvin/marvin/integration/lib/base/TrafficMonitor.py
index 4770f8b..3fadecd 100644
--- a/tools/marvin/marvin/integration/lib/base/TrafficMonitor.py
+++ b/tools/marvin/marvin/integration/lib/base/TrafficMonitor.py
@@ -28,24 +28,28 @@ class TrafficMonitor(CloudStackEntity.CloudStackEntity):
 
     def add(self, apiclient, url, zoneid, **kwargs):
         cmd = addTrafficMonitor.addTrafficMonitorCmd()
+        cmd.id = self.id
         cmd.url = url
         cmd.zoneid = zoneid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         trafficmonitor = apiclient.addTrafficMonitor(cmd)
+        return trafficmonitor
 
 
     @classmethod
     def list(self, apiclient, zoneid, **kwargs):
         cmd = listTrafficMonitors.listTrafficMonitorsCmd()
         cmd.zoneid = zoneid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         trafficmonitor = apiclient.listTrafficMonitors(cmd)
         return map(lambda e: TrafficMonitor(e.__dict__), trafficmonitor)
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteTrafficMonitor.deleteTrafficMonitorCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         trafficmonitor = apiclient.deleteTrafficMonitor(cmd)
+        return trafficmonitor
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/TrafficType.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/TrafficType.py b/tools/marvin/marvin/integration/lib/base/TrafficType.py
index 7a14083..7ef028c 100644
--- a/tools/marvin/marvin/integration/lib/base/TrafficType.py
+++ b/tools/marvin/marvin/integration/lib/base/TrafficType.py
@@ -29,31 +29,37 @@ class TrafficType(CloudStackEntity.CloudStackEntity):
 
     def add(self, apiclient, traffictype, physicalnetworkid, **kwargs):
         cmd = addTrafficType.addTrafficTypeCmd()
+        cmd.id = self.id
         cmd.physicalnetworkid = physicalnetworkid
         cmd.traffictype = traffictype
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         traffictype = apiclient.addTrafficType(cmd)
+        return traffictype
 
 
     @classmethod
     def list(self, apiclient, physicalnetworkid, **kwargs):
         cmd = listTrafficTypes.listTrafficTypesCmd()
         cmd.physicalnetworkid = physicalnetworkid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         traffictype = apiclient.listTrafficTypes(cmd)
         return map(lambda e: TrafficType(e.__dict__), traffictype)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateTrafficType.updateTrafficTypeCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         traffictype = apiclient.updateTrafficType(cmd)
+        return traffictype
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteTrafficType.deleteTrafficTypeCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         traffictype = apiclient.deleteTrafficType(cmd)
+        return traffictype
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/TrafficTypeImplementors.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/TrafficTypeImplementors.py b/tools/marvin/marvin/integration/lib/base/TrafficTypeImplementors.py
index 36b3ebc..50277f3 100644
--- a/tools/marvin/marvin/integration/lib/base/TrafficTypeImplementors.py
+++ b/tools/marvin/marvin/integration/lib/base/TrafficTypeImplementors.py
@@ -27,7 +27,7 @@ class TrafficTypeImplementors(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listTrafficTypeImplementors.listTrafficTypeImplementorsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         traffictypeimplementors = apiclient.listTrafficTypeImplementors(cmd)
         return map(lambda e: TrafficTypeImplementors(e.__dict__), traffictypeimplementors)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/UsageRecords.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/UsageRecords.py b/tools/marvin/marvin/integration/lib/base/UsageRecords.py
index 8eb2c82..6c0776c 100644
--- a/tools/marvin/marvin/integration/lib/base/UsageRecords.py
+++ b/tools/marvin/marvin/integration/lib/base/UsageRecords.py
@@ -30,15 +30,17 @@ class UsageRecords(CloudStackEntity.CloudStackEntity):
         cmd = listUsageRecords.listUsageRecordsCmd()
         cmd.enddate = enddate
         cmd.startdate = startdate
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         usagerecords = apiclient.listUsageRecords(cmd)
         return map(lambda e: UsageRecords(e.__dict__), usagerecords)
 
 
     def generate(self, apiclient, startdate, enddate, **kwargs):
         cmd = generateUsageRecords.generateUsageRecordsCmd()
+        cmd.id = self.id
         cmd.enddate = enddate
         cmd.startdate = startdate
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         usagerecords = apiclient.generateUsageRecords(cmd)
+        return usagerecords
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/UsageTypes.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/UsageTypes.py b/tools/marvin/marvin/integration/lib/base/UsageTypes.py
index d0e8dcd..a490643 100644
--- a/tools/marvin/marvin/integration/lib/base/UsageTypes.py
+++ b/tools/marvin/marvin/integration/lib/base/UsageTypes.py
@@ -27,7 +27,7 @@ class UsageTypes(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listUsageTypes.listUsageTypesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         usagetypes = apiclient.listUsageTypes(cmd)
         return map(lambda e: UsageTypes(e.__dict__), usagetypes)
 


[22/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
CLOUDSTACK-658 - Scaleup vm support for Xenserver
Added the framweork so that it can be extended for vmware and kvm as well.
Added unitests and marvin tests.


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

Branch: refs/heads/marvin_refactor
Commit: fae09fe19eb62040f7ac7e533ac573cfbb2e3966
Parents: 3e88a43
Author: Nitin Mehta <ni...@citrix.com>
Authored: Thu Mar 28 16:43:37 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:06:01 2013 +0530

----------------------------------------------------------------------
 .../xenserver/Add-To-VCPUs-Params-Live.sh          |    1 -
 test/integration/smoke/test_ScaleVm.py             |   26 +++++++-------
 2 files changed, 13 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fae09fe1/scripts/vm/hypervisor/xenserver/Add-To-VCPUs-Params-Live.sh
----------------------------------------------------------------------
diff --git a/scripts/vm/hypervisor/xenserver/Add-To-VCPUs-Params-Live.sh b/scripts/vm/hypervisor/xenserver/Add-To-VCPUs-Params-Live.sh
index 0fadcd8..b44fec9 100644
--- a/scripts/vm/hypervisor/xenserver/Add-To-VCPUs-Params-Live.sh
+++ b/scripts/vm/hypervisor/xenserver/Add-To-VCPUs-Params-Live.sh
@@ -30,4 +30,3 @@ if [[ $key == "cap" ]]
 then
     xe vm-param-set VCPUs-params:cap=$value uuid=$uuid
 fi
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fae09fe1/test/integration/smoke/test_ScaleVm.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_ScaleVm.py b/test/integration/smoke/test_ScaleVm.py
index 710d2ad..8f48c6f 100644
--- a/test/integration/smoke/test_ScaleVm.py
+++ b/test/integration/smoke/test_ScaleVm.py
@@ -5,9 +5,9 @@
 # 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
@@ -41,12 +41,12 @@ class Services:
                     "firstname": "Test",
                     "lastname": "User",
                     "username": "test",
-                    # Random characters are appended in create account to 
+                    # Random characters are appended in create account to
                     # ensure unique username generated each time
                     "password": "password",
                 },
                 "small":
-                # Create a small virtual machine instance with disk offering 
+                # Create a small virtual machine instance with disk offering
                 {
                     "displayname": "testserver",
                     "username": "root", # VM creds for SSH
@@ -61,7 +61,7 @@ class Services:
                 {
                  "small":
                     {
-                     # Small service offering ID to for change VM 
+                     # Small service offering ID to for change VM
                      # service offering from medium to small
                         "name": "SmallInstance",
                         "displaytext": "SmallInstance",
@@ -71,7 +71,7 @@ class Services:
                     },
                 "big":
                     {
-                     # Big service offering ID to for change VM 
+                     # Big service offering ID to for change VM
                         "name": "BigInstance",
                         "displaytext": "BigInstance",
                         "cpunumber": 1,
@@ -127,7 +127,7 @@ class TestScaleVm(cloudstackTestCase):
                                     cls.api_client,
                                     cls.services["service_offerings"]["small"]
                                     )
-        
+
         cls.big_offering = ServiceOffering.create(
                                     cls.api_client,
                                     cls.services["service_offerings"]["big"]
@@ -166,22 +166,22 @@ class TestScaleVm(cloudstackTestCase):
 
     @attr(tags = ["advanced", "basic", "multicluster", "storagemotion", "xenserver"])
     def test_01_scale_vm(self):
-        """Test scale virtual machine 
+        """Test scale virtual machine
         """
         # Validate the following
         # Scale up the vm and see if it scales to the new svc offering and is finally in running state
-        
-      
-      
+
+
+
         self.debug("Scaling VM-ID: %s to service offering: %s" % (
                                         self.virtual_machine.id,
                                         self.big_offering.id
                                         ))
-        
+
         cmd = scaleVirtualMachine.scaleVirtualMachineCmd()
         cmd.serviceofferingid = self.big_offering.id
         cmd.id = self.virtual_machine.id
-        self.apiclient.scaleVirtualMachine(cmd)  
+        self.apiclient.scaleVirtualMachine(cmd)
 
         list_vm_response = list_virtual_machines(
                                             self.apiclient,


[23/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
Zone wide primary storage is not supported for Xenserver as the Hypervisor but for KVM only


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

Branch: refs/heads/marvin_refactor
Commit: b7b8fdc457398865cbf66d662223c4a914e453eb
Parents: fae09fe
Author: Pranav Saxena <pr...@citrix.com>
Authored: Fri Mar 29 20:45:44 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:06:01 2013 +0530

----------------------------------------------------------------------
 ui/scripts/zoneWizard.js |   34 +++++++++++++++++++++++++---------
 1 files changed, 25 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b7b8fdc4/ui/scripts/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js
index 53f1684..51c956d 100755
--- a/ui/scripts/zoneWizard.js
+++ b/ui/scripts/zoneWizard.js
@@ -1186,15 +1186,31 @@
                     label: 'label.scope',
                     select: function(args) {
 
-            var scope = [
-                        { id: 'zone', description: _l('label.zone.wide') },
-                        { id: 'cluster', description: _l('label.cluster') },
-                        { id: 'host', description: _l('label.host') }
-                      ];
-
-                      args.response.success({
-                        data: scope
-                      });
+             var selectedHypervisorObj = {
+                hypervisortype: $.isArray(args.context.zones[0].hypervisor) ?
+                  // We want the cluster's hypervisor type
+                  args.context.zones[0].hypervisor[1] : args.context.zones[0].hypervisor
+              };
+
+              if(selectedHypervisorObj == null) {
+                return;
+              }
+
+                // ZWPS not supported for Xenserver
+             if(selectedHypervisorObj.hypervisortype == "XenServer"){
+                       var scope=[];
+                       scope.push({ id: 'cluster', description: _l('label.cluster') });
+                       scope.push({ id: 'host', description: _l('label.host') });
+                       args.response.success({data: scope});
+                    }
+
+              else {
+                       var scope=[];
+                       scope.push({ id: 'zone', description: _l('label.zone.wide') });
+                       scope.push({ id: 'cluster', description: _l('label.cluster') });
+                       scope.push({ id: 'host', description: _l('label.host') });
+                       args.response.success({data: scope});
+                    }
 
                 }
 


[34/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
marvin-refactor: create takes factories not reqd args

- Let all entities inherit from CloudStackEntity
- create and list are classmethods since they work without need for an
  entity to exist
- create takes only factories by default. no need for long param list.
    Entitiy.create(apiclient) will give entity out of default factory
- Use entityFactory.attributes() to init entities

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


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

Branch: refs/heads/marvin_refactor
Commit: 89ac2ab124c4201703b73187db23c1da1011e829
Parents: de442df
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Sat Jan 26 21:43:17 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:19:15 2013 +0530

----------------------------------------------------------------------
 .../integration/lib/base/AccountFromProject.py     |    4 ++++
 .../integration/lib/base/AccountToProject.py       |    4 ++++
 .../marvin/marvin/integration/lib/base/ApiLimit.py |    4 ++++
 .../marvin/integration/lib/base/AsyncJobResult.py  |    4 ++++
 .../marvin/integration/lib/base/CloudIdentifier.py |    4 ++++
 .../integration/lib/base/CustomCertificate.py      |    4 ++++
 .../integration/lib/base/DefaultZoneForAccount.py  |    4 ++++
 .../integration/lib/base/FromLoadBalancerRule.py   |    4 ++++
 .../integration/lib/base/HostForMaintenance.py     |    4 ++++
 .../marvin/integration/lib/base/HostMaintenance.py |    4 ++++
 .../marvin/integration/lib/base/HostPassword.py    |    4 ++++
 .../marvin/integration/lib/base/IpAddress.py       |    4 ++++
 .../lib/base/PasswordForVirtualMachine.py          |    4 ++++
 .../marvin/integration/lib/base/ResourceCount.py   |    4 ++++
 .../integration/lib/base/SecondaryStorage.py       |    4 ++++
 .../integration/lib/base/SecurityGroupEgress.py    |    4 ++++
 .../integration/lib/base/SecurityGroupIngress.py   |    4 ++++
 .../integration/lib/base/ServiceForRouter.py       |    4 ++++
 .../integration/lib/base/ServiceForSystemVm.py     |    4 ++++
 .../lib/base/ServiceForVirtualMachine.py           |    4 ++++
 .../marvin/integration/lib/base/StaticNat.py       |    4 ++++
 .../integration/lib/base/StorageMaintenance.py     |    4 ++++
 .../integration/lib/base/ToLoadBalancerRule.py     |    4 ++++
 .../marvin/marvin/integration/lib/base/UserKeys.py |    4 ++++
 .../marvin/integration/lib/base/VMPassword.py      |    4 ++++
 25 files changed, 100 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/AccountFromProject.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AccountFromProject.py b/tools/marvin/marvin/integration/lib/base/AccountFromProject.py
index c627ea6..092f5e2 100644
--- a/tools/marvin/marvin/integration/lib/base/AccountFromProject.py
+++ b/tools/marvin/marvin/integration/lib/base/AccountFromProject.py
@@ -24,6 +24,10 @@ class AccountFromProject(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def delete(self, apiclient, projectid, account, **kwargs):
         cmd = deleteAccountFromProject.deleteAccountFromProjectCmd()
         cmd.account = account

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/AccountToProject.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AccountToProject.py b/tools/marvin/marvin/integration/lib/base/AccountToProject.py
index c74c447..a1bdccf 100644
--- a/tools/marvin/marvin/integration/lib/base/AccountToProject.py
+++ b/tools/marvin/marvin/integration/lib/base/AccountToProject.py
@@ -24,6 +24,10 @@ class AccountToProject(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def add(self, apiclient, projectid, **kwargs):
         cmd = addAccountToProject.addAccountToProjectCmd()
         cmd.projectid = projectid

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/ApiLimit.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ApiLimit.py b/tools/marvin/marvin/integration/lib/base/ApiLimit.py
index 4821801..4a56df8 100644
--- a/tools/marvin/marvin/integration/lib/base/ApiLimit.py
+++ b/tools/marvin/marvin/integration/lib/base/ApiLimit.py
@@ -25,6 +25,10 @@ class ApiLimit(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def reset(self, apiclient, **kwargs):
         cmd = resetApiLimit.resetApiLimitCmd()
         [setattr(cmd, key, value) for key,value in kwargs.items]

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/AsyncJobResult.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AsyncJobResult.py b/tools/marvin/marvin/integration/lib/base/AsyncJobResult.py
index fda48d8..5383684 100644
--- a/tools/marvin/marvin/integration/lib/base/AsyncJobResult.py
+++ b/tools/marvin/marvin/integration/lib/base/AsyncJobResult.py
@@ -24,6 +24,10 @@ class AsyncJobResult(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def query(self, apiclient, jobid, **kwargs):
         cmd = queryAsyncJobResult.queryAsyncJobResultCmd()
         cmd.jobid = jobid

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/CloudIdentifier.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/CloudIdentifier.py b/tools/marvin/marvin/integration/lib/base/CloudIdentifier.py
index e98b651..ed2dd6e 100644
--- a/tools/marvin/marvin/integration/lib/base/CloudIdentifier.py
+++ b/tools/marvin/marvin/integration/lib/base/CloudIdentifier.py
@@ -24,6 +24,10 @@ class CloudIdentifier(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def get(self, apiclient, userid, **kwargs):
         cmd = getCloudIdentifier.getCloudIdentifierCmd()
         cmd.userid = userid

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/CustomCertificate.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/CustomCertificate.py b/tools/marvin/marvin/integration/lib/base/CustomCertificate.py
index 5e38920..c9a2dbf 100644
--- a/tools/marvin/marvin/integration/lib/base/CustomCertificate.py
+++ b/tools/marvin/marvin/integration/lib/base/CustomCertificate.py
@@ -24,6 +24,10 @@ class CustomCertificate(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def upload(self, apiclient, domainsuffix, certificate, **kwargs):
         cmd = uploadCustomCertificate.uploadCustomCertificateCmd()
         cmd.certificate = certificate

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/DefaultZoneForAccount.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/DefaultZoneForAccount.py b/tools/marvin/marvin/integration/lib/base/DefaultZoneForAccount.py
index 6605dcf..86e3469 100644
--- a/tools/marvin/marvin/integration/lib/base/DefaultZoneForAccount.py
+++ b/tools/marvin/marvin/integration/lib/base/DefaultZoneForAccount.py
@@ -24,6 +24,10 @@ class DefaultZoneForAccount(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def mark(self, apiclient, account, domainid, zoneid, **kwargs):
         cmd = markDefaultZoneForAccount.markDefaultZoneForAccountCmd()
         cmd.account = account

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/FromLoadBalancerRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/FromLoadBalancerRule.py b/tools/marvin/marvin/integration/lib/base/FromLoadBalancerRule.py
index f3ae80a..114001a 100644
--- a/tools/marvin/marvin/integration/lib/base/FromLoadBalancerRule.py
+++ b/tools/marvin/marvin/integration/lib/base/FromLoadBalancerRule.py
@@ -24,6 +24,10 @@ class FromLoadBalancerRule(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def remove(self, apiclient, id, virtualmachineids, **kwargs):
         cmd = removeFromLoadBalancerRule.removeFromLoadBalancerRuleCmd()
         cmd.id = id

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/HostForMaintenance.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/HostForMaintenance.py b/tools/marvin/marvin/integration/lib/base/HostForMaintenance.py
index 119bc7a..6aaefee 100644
--- a/tools/marvin/marvin/integration/lib/base/HostForMaintenance.py
+++ b/tools/marvin/marvin/integration/lib/base/HostForMaintenance.py
@@ -24,6 +24,10 @@ class HostForMaintenance(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def prepare(self, apiclient, id, **kwargs):
         cmd = prepareHostForMaintenance.prepareHostForMaintenanceCmd()
         cmd.id = id

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/HostMaintenance.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/HostMaintenance.py b/tools/marvin/marvin/integration/lib/base/HostMaintenance.py
index 15d94d0..c28afd0 100644
--- a/tools/marvin/marvin/integration/lib/base/HostMaintenance.py
+++ b/tools/marvin/marvin/integration/lib/base/HostMaintenance.py
@@ -24,6 +24,10 @@ class HostMaintenance(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def cancel(self, apiclient, id, **kwargs):
         cmd = cancelHostMaintenance.cancelHostMaintenanceCmd()
         cmd.id = id

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/HostPassword.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/HostPassword.py b/tools/marvin/marvin/integration/lib/base/HostPassword.py
index c2df321..a1814a0 100644
--- a/tools/marvin/marvin/integration/lib/base/HostPassword.py
+++ b/tools/marvin/marvin/integration/lib/base/HostPassword.py
@@ -24,6 +24,10 @@ class HostPassword(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def update(self, apiclient, username, password, **kwargs):
         cmd = updateHostPassword.updateHostPasswordCmd()
         cmd.password = password

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/IpAddress.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/IpAddress.py b/tools/marvin/marvin/integration/lib/base/IpAddress.py
index 5c56510..334c747 100644
--- a/tools/marvin/marvin/integration/lib/base/IpAddress.py
+++ b/tools/marvin/marvin/integration/lib/base/IpAddress.py
@@ -25,6 +25,10 @@ class IpAddress(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def disassociate(self, apiclient, id, **kwargs):
         cmd = disassociateIpAddress.disassociateIpAddressCmd()
         cmd.id = id

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/PasswordForVirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/PasswordForVirtualMachine.py b/tools/marvin/marvin/integration/lib/base/PasswordForVirtualMachine.py
index 262c327..8a6b351 100644
--- a/tools/marvin/marvin/integration/lib/base/PasswordForVirtualMachine.py
+++ b/tools/marvin/marvin/integration/lib/base/PasswordForVirtualMachine.py
@@ -24,6 +24,10 @@ class PasswordForVirtualMachine(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def reset(self, apiclient, id, **kwargs):
         cmd = resetPasswordForVirtualMachine.resetPasswordForVirtualMachineCmd()
         cmd.id = id

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/ResourceCount.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ResourceCount.py b/tools/marvin/marvin/integration/lib/base/ResourceCount.py
index 8c54140..9677d2e 100644
--- a/tools/marvin/marvin/integration/lib/base/ResourceCount.py
+++ b/tools/marvin/marvin/integration/lib/base/ResourceCount.py
@@ -24,6 +24,10 @@ class ResourceCount(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def update(self, apiclient, domainid, **kwargs):
         cmd = updateResourceCount.updateResourceCountCmd()
         cmd.domainid = domainid

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/SecondaryStorage.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SecondaryStorage.py b/tools/marvin/marvin/integration/lib/base/SecondaryStorage.py
index 54f647e..cc18f41 100644
--- a/tools/marvin/marvin/integration/lib/base/SecondaryStorage.py
+++ b/tools/marvin/marvin/integration/lib/base/SecondaryStorage.py
@@ -24,6 +24,10 @@ class SecondaryStorage(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def add(self, apiclient, url, **kwargs):
         cmd = addSecondaryStorage.addSecondaryStorageCmd()
         cmd.url = url

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/SecurityGroupEgress.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SecurityGroupEgress.py b/tools/marvin/marvin/integration/lib/base/SecurityGroupEgress.py
index b5e656f..995705c 100644
--- a/tools/marvin/marvin/integration/lib/base/SecurityGroupEgress.py
+++ b/tools/marvin/marvin/integration/lib/base/SecurityGroupEgress.py
@@ -25,6 +25,10 @@ class SecurityGroupEgress(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def authorize(self, apiclient, **kwargs):
         cmd = authorizeSecurityGroupEgress.authorizeSecurityGroupEgressCmd()
         [setattr(cmd, key, value) for key,value in kwargs.items]

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/SecurityGroupIngress.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SecurityGroupIngress.py b/tools/marvin/marvin/integration/lib/base/SecurityGroupIngress.py
index 453251b..12e8848 100644
--- a/tools/marvin/marvin/integration/lib/base/SecurityGroupIngress.py
+++ b/tools/marvin/marvin/integration/lib/base/SecurityGroupIngress.py
@@ -25,6 +25,10 @@ class SecurityGroupIngress(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def authorize(self, apiclient, **kwargs):
         cmd = authorizeSecurityGroupIngress.authorizeSecurityGroupIngressCmd()
         [setattr(cmd, key, value) for key,value in kwargs.items]

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/ServiceForRouter.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ServiceForRouter.py b/tools/marvin/marvin/integration/lib/base/ServiceForRouter.py
index f568bcb..645f035 100644
--- a/tools/marvin/marvin/integration/lib/base/ServiceForRouter.py
+++ b/tools/marvin/marvin/integration/lib/base/ServiceForRouter.py
@@ -24,6 +24,10 @@ class ServiceForRouter(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def change(self, apiclient, id, serviceofferingid, **kwargs):
         cmd = changeServiceForRouter.changeServiceForRouterCmd()
         cmd.id = id

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/ServiceForSystemVm.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ServiceForSystemVm.py b/tools/marvin/marvin/integration/lib/base/ServiceForSystemVm.py
index fb1d05a..0f29f99 100644
--- a/tools/marvin/marvin/integration/lib/base/ServiceForSystemVm.py
+++ b/tools/marvin/marvin/integration/lib/base/ServiceForSystemVm.py
@@ -24,6 +24,10 @@ class ServiceForSystemVm(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def change(self, apiclient, id, serviceofferingid, **kwargs):
         cmd = changeServiceForSystemVm.changeServiceForSystemVmCmd()
         cmd.id = id

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/ServiceForVirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ServiceForVirtualMachine.py b/tools/marvin/marvin/integration/lib/base/ServiceForVirtualMachine.py
index 3ff154d..0fdf295 100644
--- a/tools/marvin/marvin/integration/lib/base/ServiceForVirtualMachine.py
+++ b/tools/marvin/marvin/integration/lib/base/ServiceForVirtualMachine.py
@@ -24,6 +24,10 @@ class ServiceForVirtualMachine(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def change(self, apiclient, id, serviceofferingid, **kwargs):
         cmd = changeServiceForVirtualMachine.changeServiceForVirtualMachineCmd()
         cmd.id = id

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/StaticNat.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/StaticNat.py b/tools/marvin/marvin/integration/lib/base/StaticNat.py
index 9aee3ee..87e22f0 100644
--- a/tools/marvin/marvin/integration/lib/base/StaticNat.py
+++ b/tools/marvin/marvin/integration/lib/base/StaticNat.py
@@ -25,6 +25,10 @@ class StaticNat(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def enable(self, apiclient, ipaddressid, virtualmachineid, **kwargs):
         cmd = enableStaticNat.enableStaticNatCmd()
         cmd.ipaddressid = ipaddressid

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/StorageMaintenance.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/StorageMaintenance.py b/tools/marvin/marvin/integration/lib/base/StorageMaintenance.py
index 005c6ce..b33a464 100644
--- a/tools/marvin/marvin/integration/lib/base/StorageMaintenance.py
+++ b/tools/marvin/marvin/integration/lib/base/StorageMaintenance.py
@@ -25,6 +25,10 @@ class StorageMaintenance(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def cancel(self, apiclient, id, **kwargs):
         cmd = cancelStorageMaintenance.cancelStorageMaintenanceCmd()
         cmd.id = id

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py b/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py
index 58fcf04..6cd2b3d 100644
--- a/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py
+++ b/tools/marvin/marvin/integration/lib/base/ToLoadBalancerRule.py
@@ -24,6 +24,10 @@ class ToLoadBalancerRule(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def assign(self, apiclient, id, virtualmachineids, **kwargs):
         cmd = assignToLoadBalancerRule.assignToLoadBalancerRuleCmd()
         cmd.id = id

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/UserKeys.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/UserKeys.py b/tools/marvin/marvin/integration/lib/base/UserKeys.py
index 85433c1..429062b 100644
--- a/tools/marvin/marvin/integration/lib/base/UserKeys.py
+++ b/tools/marvin/marvin/integration/lib/base/UserKeys.py
@@ -24,6 +24,10 @@ class UserKeys(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def register(self, apiclient, id, **kwargs):
         cmd = registerUserKeys.registerUserKeysCmd()
         cmd.id = id

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ac2ab1/tools/marvin/marvin/integration/lib/base/VMPassword.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VMPassword.py b/tools/marvin/marvin/integration/lib/base/VMPassword.py
index 78cb4f1..7cc271d 100644
--- a/tools/marvin/marvin/integration/lib/base/VMPassword.py
+++ b/tools/marvin/marvin/integration/lib/base/VMPassword.py
@@ -24,6 +24,10 @@ class VMPassword(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
     def get(self, apiclient, id, **kwargs):
         cmd = getVMPassword.getVMPasswordCmd()
         cmd.id = id


[02/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
fixing unittests

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


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

Branch: refs/heads/marvin_refactor
Commit: a57cbfb59a6892b2f6ff7aca6e241b5641600ac0
Parents: 5117278
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Mon Mar 18 18:15:40 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:00:35 2013 +0530

----------------------------------------------------------------------
 .../integration/lib/factory/test/testFactories.py  |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a57cbfb5/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/test/testFactories.py b/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
index b5a20dd..257239c 100644
--- a/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
+++ b/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
@@ -22,7 +22,7 @@ from marvin.cloudstackTestClient import cloudstackTestClient
 
 class AccountFactoryTest(unittest.TestCase):
     def setUp(self):
-        self.apiClient = cloudstackTestClient(mgtSvr='localhost')
+        self.apiClient = cloudstackTestClient(mgtSvr='localhost').getApiClient()
 
     def test_userAccountFactory(self):
         af = AccountFactory.AccountFactory()
@@ -40,4 +40,4 @@ class AccountFactoryTest(unittest.TestCase):
         self.assertTrue(accnt is not None, msg="no account created by factory")
 
     def tearDown(self):
-        self.apiClient.close()
\ No newline at end of file
+        pass


[15/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
CLOUDSTACK-1065: cloudstack UI - AWS Style Regions - remove region field from Add Account dialog since createAccount API does not take in regionid parameter.


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

Branch: refs/heads/marvin_refactor
Commit: b9dc54602ecf342ba4886905ba6ce06587fbb5a6
Parents: e0a0c1f
Author: Jessica Wang <je...@citrix.com>
Authored: Wed Mar 20 16:47:52 2013 -0700
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:02:17 2013 +0530

----------------------------------------------------------------------
 ui/scripts/accounts.js |  145 ++++---------------------------------------
 1 files changed, 13 insertions(+), 132 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b9dc5460/ui/scripts/accounts.js
----------------------------------------------------------------------
diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js
index 8353d70..e36852f 100644
--- a/ui/scripts/accounts.js
+++ b/ui/scripts/accounts.js
@@ -112,7 +112,7 @@
                     label: 'label.last.name',
                     validation: { required: true },
                     docID: 'helpAccountLastName'
-                  },                  
+                  },
                   domainid: {
                     label: 'label.domain',
                     docID: 'helpAccountDomain',
@@ -195,7 +195,7 @@
                 $.extend(data, {
 								  email: args.data.email,
                   firstname: args.data.firstname,
-                  lastname: args.data.lastname,                 
+                  lastname: args.data.lastname,
                   domainid: args.data.domainid									
 								});								              
 
@@ -290,7 +290,7 @@
 									  domainid: accountObj.domainid,
 										account: accountObj.name,
 										newname: args.data.name,
-										networkdomain: args.data.networkdomain                    
+										networkdomain: args.data.networkdomain
 									};
                 
                   $.ajax({
@@ -409,77 +409,6 @@
 										});
 									}
 
-									if(args.data.cpuLimit != null) {
-									  var data = {
-										  resourceType: 8,
-											max: args.data.cpuLimit,
-											domainid: accountObj.domainid,
-											account: accountObj.name
-										};
-
-										$.ajax({
-											url: createURL('updateResourceLimit'),
-											data: data,
-											async: false,
-											success: function(json) {
-												accountObj["cpuLimit"] = args.data.cpuLimit;
-											}
-										});
-									}
-
-									if(args.data.memoryLimit != null) {
-									  var data = {
-										  resourceType: 9,
-											max: args.data.memoryLimit,
-											domainid: accountObj.domainid,
-											account: accountObj.name
-										};
-
-										$.ajax({
-											url: createURL('updateResourceLimit'),
-											data: data,
-											async: false,
-											success: function(json) {
-												accountObj["memoryLimit"] = args.data.memoryLimit;
-											}
-										});
-									}
-
-									if(args.data.primaryStorageLimit != null) {
-									  var data = {
-										  resourceType: 10,
-											max: args.data.primaryStorageLimit,
-											domainid: accountObj.domainid,
-											account: accountObj.name
-										};
-
-										$.ajax({
-											url: createURL('updateResourceLimit'),
-											data: data,
-											async: false,
-											success: function(json) {
-												accountObj["primaryStorageLimit"] = args.data.primaryStorageLimit;
-											}
-										});
-									}
-
-									if(args.data.secondaryStorageLimit != null) {
-										  var data = {
-											  resourceType: 11,
-												max: args.data.secondaryStorageLimit,
-												domainid: accountObj.domainid,
-												account: accountObj.name
-											};
-
-											$.ajax({
-												url: createURL('updateResourceLimit'),
-												data: data,
-												async: false,
-												success: function(json) {
-													accountObj["secondaryStorageLimit"] = args.data.secondaryStorageLimit;
-												}
-											});
-										}
                   args.response.success({data: accountObj});
                 }
               },
@@ -704,7 +633,7 @@
                       converter: function(args){
                         return cloudStack.converters.toRole(args);
                       }
-                    },                    
+                    },
                     domain: { label: 'label.domain' },
                     state: { label: 'label.state' },
                     networkdomain: {
@@ -769,42 +698,6 @@
 												  return false;
 											}
                     },
-                    cpuLimit: {
-                      label: 'label.cpu.limits',
-                      isEditable: function(context) {
-  											  if (context.accounts[0].accounttype == roleTypeUser || context.accounts[0].accounttype == roleTypeDomainAdmin) //updateResourceLimits is only allowed on account whose type is user or domain-admin
-  												  return true;
-  												else
-  												  return false;
-  											}
-                    },
-                    memoryLimit: {
-                      label: 'label.memory.limits',
-                      isEditable: function(context) {
-  											  if (context.accounts[0].accounttype == roleTypeUser || context.accounts[0].accounttype == roleTypeDomainAdmin) //updateResourceLimits is only allowed on account whose type is user or domain-admin
-  												  return true;
-  												else
-  												  return false;
-  											}
-                    },
-                    primaryStorageLimit: {
-                      label: 'label.primary.storage.limits',
-                      isEditable: function(context) {
-  											  if (context.accounts[0].accounttype == roleTypeUser || context.accounts[0].accounttype == roleTypeDomainAdmin) //updateResourceLimits is only allowed on account whose type is user or domain-admin
-  												  return true;
-  												else
-  												  return false;
-  											}
-                    },
-                    secondaryStorageLimit: {
-                      label: 'label.secondary.storage.limits',
-                      isEditable: function(context) {
-  											  if (context.accounts[0].accounttype == roleTypeUser || context.accounts[0].accounttype == roleTypeDomainAdmin) //updateResourceLimits is only allowed on account whose type is user or domain-admin
-  												  return true;
-  												else
-  												  return false;
-  											}
-                    },
 
                     vmtotal: { label: 'label.total.of.vm' },
                     iptotal: { label: 'label.total.of.ip' },
@@ -832,11 +725,11 @@
                 dataProvider: function(args) {
 								  var data = {
 									  id: args.context.accounts[0].id
-									};
+									};								
 									$.ajax({
 										url: createURL('listAccounts'),
-										data: data,
-										success: function(json) {
+										data: data,					
+										success: function(json) {		
 											var accountObj = json.listaccountsresponse.account[0];
                       var data = {
 											  domainid: accountObj.domainid,
@@ -844,7 +737,7 @@
 											};
 											$.ajax({
 												url: createURL('listResourceLimits'),
-												data: data,
+												data: data,											
 												success: function(json) {
 													var limits = json.listresourcelimitsresponse.resourcelimit;													
 													if (limits != null) {
@@ -866,34 +759,22 @@
 															case "4":
 																accountObj["templateLimit"] = limit.max;
 																break;
-															case "7":
+                              case "7":
 																accountObj["vpcLimit"] = limit.max;
 																break;
-															case "8":
-																accountObj["cpuLimit"] = limit.max;
-																break;
-															case "9":
-																accountObj["memoryLimit"] = limit.max;
-																break;
-															case "10":
-																accountObj["primaryStorageLimit"] = limit.max;
-																break;
-															case "11":
-																accountObj["secondaryStorageLimit"] = limit.max;
-																break;
 															}
 														}
-													}
+													}																										
 													args.response.success(
 														{
 															actionFilter: accountActionfilter,
 															data: accountObj 
 														}
-													);
+													);							
 												}
-											});
+											});											
 										}
-									});
+									});		
                 }
               }
             }


[46/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
working virtulmachine test

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


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

Branch: refs/heads/marvin_refactor
Commit: c7c15cfad1ea25325540b9274925e02710efeca6
Parents: fed5840
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Sun Mar 31 21:55:23 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:19:29 2013 +0530

----------------------------------------------------------------------
 .../integration/lib/factory/TemplateFactory.py     |   11 +++++-
 .../marvin/integration/lib/factory/UserFactory.py  |    1 +
 .../lib/factory/VirtualMachineFactory.py           |    7 +++-
 .../integration/lib/factory/test/testFactories.py  |   26 ++++++++++++++-
 .../marvin/marvin/integration/lib/generateBase.py  |    3 +-
 5 files changed, 42 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c7c15cfa/tools/marvin/marvin/integration/lib/factory/TemplateFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/TemplateFactory.py b/tools/marvin/marvin/integration/lib/factory/TemplateFactory.py
index 175a6e9..e2bb023 100644
--- a/tools/marvin/marvin/integration/lib/factory/TemplateFactory.py
+++ b/tools/marvin/marvin/integration/lib/factory/TemplateFactory.py
@@ -16,10 +16,17 @@
 # under the License.
 import factory
 from marvin.integration.lib.base import Template
-class TemplateFactory(factory.Factory):
+from marvin.integration.lib.factory.CloudStackBaseFactory import CloudStackBaseFactory
 
-    FACTORY_FOR = Template
+class TemplateFactory(CloudStackBaseFactory):
+
+    FACTORY_FOR = Template.Template
 
     displaytext = None
     name = None
     ostypeid = None
+
+class DefaultBuiltInTemplateFactory(TemplateFactory):
+    ostype = 'CentOS 5.3 (64-bit)'
+    displaytext = 'CentOS 5.3 (64-bit)'
+    name = 'CentOS 5.3 (64-bit)'

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c7c15cfa/tools/marvin/marvin/integration/lib/factory/UserFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/UserFactory.py b/tools/marvin/marvin/integration/lib/factory/UserFactory.py
index a249478..eb2cafb 100644
--- a/tools/marvin/marvin/integration/lib/factory/UserFactory.py
+++ b/tools/marvin/marvin/integration/lib/factory/UserFactory.py
@@ -16,6 +16,7 @@
 # under the License.
 import factory
 from marvin.integration.lib.base import User
+
 class UserFactory(factory.Factory):
 
     FACTORY_FOR = User

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c7c15cfa/tools/marvin/marvin/integration/lib/factory/VirtualMachineFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/VirtualMachineFactory.py b/tools/marvin/marvin/integration/lib/factory/VirtualMachineFactory.py
index a9dc6c0..260a0ed 100644
--- a/tools/marvin/marvin/integration/lib/factory/VirtualMachineFactory.py
+++ b/tools/marvin/marvin/integration/lib/factory/VirtualMachineFactory.py
@@ -14,11 +14,14 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+
 import factory
 from marvin.integration.lib.base import VirtualMachine
-class VirtualMachineFactory(factory.Factory):
+from marvin.integration.lib.factory.CloudStackBaseFactory import CloudStackBaseFactory
+
+class VirtualMachineFactory(CloudStackBaseFactory):
 
-    FACTORY_FOR = VirtualMachine
+    FACTORY_FOR = VirtualMachine.VirtualMachine
 
     serviceofferingid = None
     templateid = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c7c15cfa/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/test/testFactories.py b/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
index 1637020..7e682c2 100644
--- a/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
+++ b/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
@@ -17,6 +17,7 @@
 
 import unittest
 from marvin.cloudstackTestClient import cloudstackTestClient
+from marvin.integration.lib.common import get_template
 
 from marvin.integration.lib.factory.AccountFactory import *
 from marvin.integration.lib.base.Account import Account
@@ -27,6 +28,13 @@ from marvin.integration.lib.base.ServiceOffering import ServiceOffering
 from marvin.integration.lib.factory.NetworkOfferingFactory import *
 from marvin.integration.lib.base.NetworkOffering import NetworkOffering
 
+from marvin.integration.lib.base.Zone import Zone
+
+from marvin.integration.lib.factory.TemplateFactory import *
+
+from marvin.integration.lib.factory.VirtualMachineFactory import *
+from marvin.integration.lib.base.VirtualMachine import VirtualMachine
+
 class AccountFactoryTest(unittest.TestCase):
     def setUp(self):
         self.apiClient = cloudstackTestClient(mgtSvr='localhost').getApiClient()
@@ -92,4 +100,20 @@ class NetworkOfferingFactoryTest(unittest.TestCase):
         sgOffering.update(self.apiClient, state='Enabled')
 
     def tearDown(self):
-        pass
\ No newline at end of file
+        pass
+
+class VirtualMachineFactoryTest(unittest.TestCase):
+    def setUp(self):
+        self.apiClient = cloudstackTestClient(mgtSvr='localhost').getApiClient()
+
+    def tearDown(self):
+        pass
+
+    def test_virtualMachineDeploy(self):
+        sf = ServiceOfferingFactory()
+        tf = DefaultBuiltInTemplateFactory()
+        zones = Zone.list(apiclient=self.apiClient)
+        template = get_template(apiclient=self.apiClient, zoneid = zones[0].id, ostype=tf.ostype)
+        vmf = VirtualMachineFactory(serviceofferingid = sf.id, templateid = template.id, zoneid = zones[0].id)
+
+        vm = VirtualMachine.create(apiclient=self.apiClient, VirtualMachineFactory=vmf)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c7c15cfa/tools/marvin/marvin/integration/lib/generateBase.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/generateBase.py b/tools/marvin/marvin/integration/lib/generateBase.py
index 2b213ff..f6d94c0 100644
--- a/tools/marvin/marvin/integration/lib/generateBase.py
+++ b/tools/marvin/marvin/integration/lib/generateBase.py
@@ -137,7 +137,8 @@ def write_entity_classes(entities):
                 else:
                     body.append(tabspace + 'def %s(self, apiclient, **kwargs):'%(action))
                 body.append(tabspace*2 + 'cmd = %(module)s.%(command)s()'%{"module": details["apimodule"], "command": details["apicmd"]})
-                body.append(tabspace*2 + 'cmd.id = self.id')
+                if action not in ['create', 'list', 'deploy']:
+                    body.append(tabspace*2 + 'cmd.id = self.id')
                 for arg in details['args']:
                     body.append(tabspace*2 + 'cmd.%s = %s'%(arg, arg))
                 body.append(tabspace*2 + '[setattr(cmd, key, value) for key,value in kwargs.iteritems()]')


[07/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
fix bug vmware create volume from snapshot will missing data


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

Branch: refs/heads/marvin_refactor
Commit: e9cc875336eab909bcbf3c7792d32d15444c5dee
Parents: 6dc6a72
Author: hongtu_zang <ho...@tcloudcomputing.com>
Authored: Sat Mar 16 09:54:09 2013 +0800
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:00:51 2013 +0530

----------------------------------------------------------------------
 .../vmware/manager/VmwareStorageManagerImpl.java   |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e9cc8753/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
index 1f11645..07a726b 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
@@ -743,7 +743,7 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager {
 
         String secondaryMountPoint = _mountService.getMountPoint(secStorageUrl);
         String exportPath =  secondaryMountPoint + "/" + secStorageDir + "/" + exportName;
-        
+
         synchronized(exportPath.intern()) {
             if(!new File(exportPath).exists()) {
                 Script command = new Script(false, "mkdir", _timeout, s_logger);


[43/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
actions on entity object require id for performing the action

For eg:
1. nf = NetworkOffering.create(apiClient, NetworkOfferingFactory())
2. nf.update(apiClient, state='Enabled')

Operation #2 requires that nf's id be supplied to enable the network
offering

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


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

Branch: refs/heads/marvin_refactor
Commit: cef66347af28e4558216c4518c8f5eaa79a5cb4c
Parents: be71fae
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Sun Mar 31 19:23:49 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:19:28 2013 +0530

----------------------------------------------------------------------
 .../marvin/marvin/integration/lib/base/Account.py  |   22 ++++--
 .../integration/lib/base/AccountFromProject.py     |    8 +-
 .../integration/lib/base/AccountToProject.py       |    8 +-
 tools/marvin/marvin/integration/lib/base/Alerts.py |    7 +-
 .../marvin/marvin/integration/lib/base/ApiLimit.py |   12 ++--
 tools/marvin/marvin/integration/lib/base/Apis.py   |    2 +-
 .../marvin/integration/lib/base/AsyncJobResult.py  |    8 +-
 .../marvin/integration/lib/base/AsyncJobs.py       |    2 +-
 .../integration/lib/base/AutoScalePolicies.py      |    2 +-
 .../marvin/integration/lib/base/AutoScalePolicy.py |    8 ++-
 .../integration/lib/base/AutoScaleVmGroup.py       |   18 +++-
 .../integration/lib/base/AutoScaleVmProfile.py     |   10 ++-
 .../integration/lib/base/BigSwitchVnsDevice.py     |   11 ++-
 .../marvin/integration/lib/base/Capabilities.py    |    2 +-
 .../marvin/marvin/integration/lib/base/Capacity.py |    2 +-
 .../marvin/integration/lib/base/CloudIdentifier.py |    8 +-
 .../marvin/marvin/integration/lib/base/Cluster.py  |   14 +++-
 .../marvin/integration/lib/base/Condition.py       |    6 +-
 tools/marvin/marvin/integration/lib/base/Config.py |    4 +-
 .../marvin/integration/lib/base/Configuration.py   |    6 +-
 .../marvin/marvin/integration/lib/base/Counter.py  |    6 +-
 .../integration/lib/base/CustomCertificate.py      |    8 +-
 .../lib/base/DefaultNicForVirtualMachine.py        |    5 +-
 .../integration/lib/base/DefaultZoneForAccount.py  |    8 +-
 .../marvin/integration/lib/base/DiskOffering.py    |   10 ++-
 tools/marvin/marvin/integration/lib/base/Domain.py |   10 ++-
 .../marvin/integration/lib/base/DomainChildren.py  |    2 +-
 .../integration/lib/base/EgressFirewallRule.py     |    7 +-
 .../marvin/integration/lib/base/EventTypes.py      |    2 +-
 tools/marvin/marvin/integration/lib/base/Events.py |    7 +-
 .../marvin/integration/lib/base/FirewallRule.py    |    6 +-
 .../lib/base/FromGlobalLoadBalancerRule.py         |   34 ++++++++
 .../integration/lib/base/FromLoadBalancerRule.py   |    8 +-
 .../integration/lib/base/GlobalLoadBalancerRule.py |   62 ++++++++++++++
 tools/marvin/marvin/integration/lib/base/Host.py   |   18 +++-
 .../integration/lib/base/HostForMaintenance.py     |    8 +-
 .../marvin/integration/lib/base/HostMaintenance.py |    8 +-
 .../marvin/integration/lib/base/HostPassword.py    |    8 +-
 .../integration/lib/base/HypervisorCapabilities.py |    6 +-
 .../marvin/integration/lib/base/Hypervisors.py     |    2 +-
 .../marvin/integration/lib/base/InstanceGroup.py   |   10 ++-
 .../marvin/integration/lib/base/IpAddress.py       |   12 ++--
 .../integration/lib/base/IpForwardingRule.py       |    6 +-
 .../marvin/integration/lib/base/IpFromNic.py       |    5 +-
 .../marvin/marvin/integration/lib/base/IpToNic.py  |    5 +-
 tools/marvin/marvin/integration/lib/base/Iso.py    |   30 +++++--
 .../marvin/integration/lib/base/IsoPermissions.py  |    6 +-
 .../integration/lib/base/LBHealthCheckPolicies.py  |   33 ++++++++
 .../integration/lib/base/LBHealthCheckPolicy.py    |   43 ++++++++++
 .../integration/lib/base/LBStickinessPolicies.py   |    2 +-
 .../integration/lib/base/LBStickinessPolicy.py     |    4 +-
 .../integration/lib/base/LoadBalancerRule.py       |   10 ++-
 .../lib/base/LoadBalancerRuleInstances.py          |    2 +-
 .../marvin/marvin/integration/lib/base/Network.py  |   14 +++-
 .../marvin/integration/lib/base/NetworkACL.py      |    6 +-
 .../marvin/integration/lib/base/NetworkDevice.py   |   10 ++-
 .../marvin/integration/lib/base/NetworkOffering.py |   10 ++-
 .../integration/lib/base/NetworkServiceProvider.py |   14 +++-
 .../integration/lib/base/NicFromVirtualMachine.py  |    5 +-
 .../integration/lib/base/NicToVirtualMachine.py    |    5 +-
 .../marvin/integration/lib/base/NiciraNvpDevice.py |   10 ++-
 .../lib/base/NiciraNvpDeviceNetworks.py            |    2 +-
 tools/marvin/marvin/integration/lib/base/Nics.py   |    3 +-
 .../marvin/integration/lib/base/OsCategories.py    |    2 +-
 .../marvin/marvin/integration/lib/base/OsTypes.py  |    2 +-
 .../lib/base/PasswordForVirtualMachine.py          |    8 +-
 .../marvin/integration/lib/base/PhysicalNetwork.py |   10 ++-
 tools/marvin/marvin/integration/lib/base/Pod.py    |   10 ++-
 .../integration/lib/base/PortForwardingRule.py     |   10 ++-
 .../marvin/integration/lib/base/PrivateGateway.py  |    6 +-
 .../marvin/marvin/integration/lib/base/Project.py  |   18 +++-
 .../marvin/integration/lib/base/ProjectAccounts.py |    2 +-
 .../integration/lib/base/ProjectInvitation.py      |   10 ++-
 .../integration/lib/base/PublicIpAddresses.py      |    2 +-
 tools/marvin/marvin/integration/lib/base/Region.py |   15 +++-
 .../marvin/integration/lib/base/RemoteAccessVpn.py |    6 +-
 tools/marvin/marvin/integration/lib/base/Remove.py |    4 +-
 .../marvin/integration/lib/base/ResourceCount.py   |    8 +-
 .../marvin/integration/lib/base/ResourceLimit.py   |    6 +-
 tools/marvin/marvin/integration/lib/base/Router.py |   18 +++-
 tools/marvin/marvin/integration/lib/base/S3.py     |    6 +-
 .../lib/base/SSHKeyForVirtualMachine.py            |    5 +-
 .../marvin/integration/lib/base/SSHKeyPair.py      |   10 ++-
 .../integration/lib/base/SecondaryStorage.py       |    8 +-
 .../marvin/integration/lib/base/SecurityGroup.py   |    6 +-
 .../integration/lib/base/SecurityGroupEgress.py    |   12 ++--
 .../integration/lib/base/SecurityGroupIngress.py   |   12 ++--
 .../integration/lib/base/ServiceForRouter.py       |    8 +-
 .../integration/lib/base/ServiceForSystemVm.py     |    8 +-
 .../lib/base/ServiceForVirtualMachine.py           |    8 +-
 .../marvin/integration/lib/base/ServiceOffering.py |   10 ++-
 .../marvin/integration/lib/base/Simulator.py       |    5 +-
 .../marvin/marvin/integration/lib/base/Snapshot.py |    6 +-
 .../integration/lib/base/SnapshotPolicies.py       |    6 +-
 .../marvin/integration/lib/base/StaticNat.py       |   12 ++--
 .../marvin/integration/lib/base/StaticRoute.py     |    6 +-
 .../integration/lib/base/StorageMaintenance.py     |   12 ++--
 .../integration/lib/base/StorageNetworkIpRange.py  |   10 ++-
 .../marvin/integration/lib/base/StoragePool.py     |   10 ++-
 .../integration/lib/base/StorageProviders.py       |   33 ++++++++
 .../lib/base/SupportedNetworkServices.py           |    2 +-
 tools/marvin/marvin/integration/lib/base/Swift.py  |    6 +-
 .../marvin/marvin/integration/lib/base/SystemVm.py |   22 ++++--
 tools/marvin/marvin/integration/lib/base/Tags.py   |    6 +-
 .../marvin/marvin/integration/lib/base/Template.py |   26 +++++--
 .../integration/lib/base/TemplatePermissions.py    |    6 +-
 .../lib/base/ToGlobalLoadBalancerRule.py           |   34 ++++++++
 .../integration/lib/base/ToLoadBalancerRule.py     |    8 +-
 .../marvin/integration/lib/base/TrafficMonitor.py  |   10 ++-
 .../marvin/integration/lib/base/TrafficType.py     |   14 +++-
 .../lib/base/TrafficTypeImplementors.py            |    2 +-
 .../marvin/integration/lib/base/UsageRecords.py    |    6 +-
 .../marvin/integration/lib/base/UsageTypes.py      |    2 +-
 tools/marvin/marvin/integration/lib/base/User.py   |   26 +++++--
 .../marvin/marvin/integration/lib/base/UserKeys.py |    8 +-
 .../marvin/integration/lib/base/VMPassword.py      |    8 +-
 .../marvin/integration/lib/base/VMSnapshot.py      |    7 +-
 tools/marvin/marvin/integration/lib/base/VPC.py    |   14 +++-
 .../marvin/integration/lib/base/VPCOffering.py     |   10 ++-
 .../marvin/integration/lib/base/VirtualMachine.py  |   45 ++++++++--
 .../integration/lib/base/VirtualRouterElement.py   |    6 +-
 .../marvin/integration/lib/base/VlanIpRange.py     |    6 +-
 tools/marvin/marvin/integration/lib/base/Volume.py |   26 +++++--
 .../marvin/integration/lib/base/VpnConnection.py   |   10 ++-
 .../integration/lib/base/VpnCustomerGateway.py     |   10 ++-
 .../marvin/integration/lib/base/VpnGateway.py      |    6 +-
 .../marvin/marvin/integration/lib/base/VpnUser.py  |   10 ++-
 tools/marvin/marvin/integration/lib/base/Zone.py   |   10 ++-
 .../integration/lib/factory/DiskOfferingFactory.py |    5 +-
 .../lib/factory/NetworkOfferingFactory.py          |   63 ++++++++++++++-
 .../integration/lib/factory/test/testFactories.py  |   29 ++++++-
 .../marvin/marvin/integration/lib/generateBase.py  |   10 ++-
 132 files changed, 1025 insertions(+), 390 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Account.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Account.py b/tools/marvin/marvin/integration/lib/base/Account.py
index c9698eb..7da8f9d 100644
--- a/tools/marvin/marvin/integration/lib/base/Account.py
+++ b/tools/marvin/marvin/integration/lib/base/Account.py
@@ -32,16 +32,20 @@ class Account(CloudStackEntity.CloudStackEntity):
 
     def enable(self, apiclient, **kwargs):
         cmd = enableAccount.enableAccountCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         account = apiclient.enableAccount(cmd)
+        return account
 
 
     def lock(self, apiclient, account, domainid, **kwargs):
         cmd = lockAccount.lockAccountCmd()
+        cmd.id = self.id
         cmd.account = account
         cmd.domainid = domainid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         account = apiclient.lockAccount(cmd)
+        return account
 
 
     @classmethod
@@ -56,28 +60,34 @@ class Account(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listAccounts.listAccountsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         account = apiclient.listAccounts(cmd)
         return map(lambda e: Account(e.__dict__), account)
 
 
     def update(self, apiclient, newname, **kwargs):
         cmd = updateAccount.updateAccountCmd()
+        cmd.id = self.id
         cmd.newname = newname
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         account = apiclient.updateAccount(cmd)
+        return account
 
 
     def disable(self, apiclient, lock, **kwargs):
         cmd = disableAccount.disableAccountCmd()
+        cmd.id = self.id
         cmd.lock = lock
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         account = apiclient.disableAccount(cmd)
+        return account
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteAccount.deleteAccountCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         account = apiclient.deleteAccount(cmd)
+        return account
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/AccountFromProject.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AccountFromProject.py b/tools/marvin/marvin/integration/lib/base/AccountFromProject.py
index 092f5e2..de86c95 100644
--- a/tools/marvin/marvin/integration/lib/base/AccountFromProject.py
+++ b/tools/marvin/marvin/integration/lib/base/AccountFromProject.py
@@ -24,14 +24,12 @@ class AccountFromProject(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def delete(self, apiclient, projectid, account, **kwargs):
         cmd = deleteAccountFromProject.deleteAccountFromProjectCmd()
+        cmd.id = self.id
         cmd.account = account
         cmd.projectid = projectid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         accountfromproject = apiclient.deleteAccountFromProject(cmd)
+        return accountfromproject
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/AccountToProject.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AccountToProject.py b/tools/marvin/marvin/integration/lib/base/AccountToProject.py
index a1bdccf..568464a 100644
--- a/tools/marvin/marvin/integration/lib/base/AccountToProject.py
+++ b/tools/marvin/marvin/integration/lib/base/AccountToProject.py
@@ -24,13 +24,11 @@ class AccountToProject(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def add(self, apiclient, projectid, **kwargs):
         cmd = addAccountToProject.addAccountToProjectCmd()
+        cmd.id = self.id
         cmd.projectid = projectid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         accounttoproject = apiclient.addAccountToProject(cmd)
+        return accounttoproject
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Alerts.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Alerts.py b/tools/marvin/marvin/integration/lib/base/Alerts.py
index e31451b..423aba8 100644
--- a/tools/marvin/marvin/integration/lib/base/Alerts.py
+++ b/tools/marvin/marvin/integration/lib/base/Alerts.py
@@ -28,12 +28,15 @@ class Alerts(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listAlerts.listAlertsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         alerts = apiclient.listAlerts(cmd)
         return map(lambda e: Alerts(e.__dict__), alerts)
 
 
     def delete(self, apiclient, **kwargs):
         cmd = deleteAlerts.deleteAlertsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         alerts = apiclient.deleteAlerts(cmd)
+        return alerts
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/ApiLimit.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ApiLimit.py b/tools/marvin/marvin/integration/lib/base/ApiLimit.py
index 4a56df8..2e895c1 100644
--- a/tools/marvin/marvin/integration/lib/base/ApiLimit.py
+++ b/tools/marvin/marvin/integration/lib/base/ApiLimit.py
@@ -25,18 +25,18 @@ class ApiLimit(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def reset(self, apiclient, **kwargs):
         cmd = resetApiLimit.resetApiLimitCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         apilimit = apiclient.resetApiLimit(cmd)
+        return apilimit
 
 
     def get(self, apiclient, **kwargs):
         cmd = getApiLimit.getApiLimitCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         apilimit = apiclient.getApiLimit(cmd)
+        return apilimit
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Apis.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Apis.py b/tools/marvin/marvin/integration/lib/base/Apis.py
index f634781..f8bba1f 100644
--- a/tools/marvin/marvin/integration/lib/base/Apis.py
+++ b/tools/marvin/marvin/integration/lib/base/Apis.py
@@ -27,7 +27,7 @@ class Apis(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listApis.listApisCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         apis = apiclient.listApis(cmd)
         return map(lambda e: Apis(e.__dict__), apis)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/AsyncJobResult.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AsyncJobResult.py b/tools/marvin/marvin/integration/lib/base/AsyncJobResult.py
index 5383684..674217c 100644
--- a/tools/marvin/marvin/integration/lib/base/AsyncJobResult.py
+++ b/tools/marvin/marvin/integration/lib/base/AsyncJobResult.py
@@ -24,13 +24,11 @@ class AsyncJobResult(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def query(self, apiclient, jobid, **kwargs):
         cmd = queryAsyncJobResult.queryAsyncJobResultCmd()
+        cmd.id = self.id
         cmd.jobid = jobid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         asyncjobresult = apiclient.queryAsyncJobResult(cmd)
+        return asyncjobresult
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/AsyncJobs.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AsyncJobs.py b/tools/marvin/marvin/integration/lib/base/AsyncJobs.py
index 451bb7f..689e562 100644
--- a/tools/marvin/marvin/integration/lib/base/AsyncJobs.py
+++ b/tools/marvin/marvin/integration/lib/base/AsyncJobs.py
@@ -27,7 +27,7 @@ class AsyncJobs(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listAsyncJobs.listAsyncJobsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         asyncjobs = apiclient.listAsyncJobs(cmd)
         return map(lambda e: AsyncJobs(e.__dict__), asyncjobs)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/AutoScalePolicies.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AutoScalePolicies.py b/tools/marvin/marvin/integration/lib/base/AutoScalePolicies.py
index 5e5f3ed..2866887 100644
--- a/tools/marvin/marvin/integration/lib/base/AutoScalePolicies.py
+++ b/tools/marvin/marvin/integration/lib/base/AutoScalePolicies.py
@@ -27,7 +27,7 @@ class AutoScalePolicies(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listAutoScalePolicies.listAutoScalePoliciesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         autoscalepolicies = apiclient.listAutoScalePolicies(cmd)
         return map(lambda e: AutoScalePolicies(e.__dict__), autoscalepolicies)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/AutoScalePolicy.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AutoScalePolicy.py b/tools/marvin/marvin/integration/lib/base/AutoScalePolicy.py
index 7ffcd82..04411ad 100644
--- a/tools/marvin/marvin/integration/lib/base/AutoScalePolicy.py
+++ b/tools/marvin/marvin/integration/lib/base/AutoScalePolicy.py
@@ -37,14 +37,18 @@ class AutoScalePolicy(CloudStackEntity.CloudStackEntity):
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateAutoScalePolicy.updateAutoScalePolicyCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         autoscalepolicy = apiclient.updateAutoScalePolicy(cmd)
+        return autoscalepolicy
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteAutoScalePolicy.deleteAutoScalePolicyCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         autoscalepolicy = apiclient.deleteAutoScalePolicy(cmd)
+        return autoscalepolicy
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/AutoScaleVmGroup.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AutoScaleVmGroup.py b/tools/marvin/marvin/integration/lib/base/AutoScaleVmGroup.py
index fc48b61..30b2091 100644
--- a/tools/marvin/marvin/integration/lib/base/AutoScaleVmGroup.py
+++ b/tools/marvin/marvin/integration/lib/base/AutoScaleVmGroup.py
@@ -31,9 +31,11 @@ class AutoScaleVmGroup(CloudStackEntity.CloudStackEntity):
 
     def enable(self, apiclient, id, **kwargs):
         cmd = enableAutoScaleVmGroup.enableAutoScaleVmGroupCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         autoscalevmgroup = apiclient.enableAutoScaleVmGroup(cmd)
+        return autoscalevmgroup
 
 
     @classmethod
@@ -48,28 +50,34 @@ class AutoScaleVmGroup(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listAutoScaleVmGroups.listAutoScaleVmGroupsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         autoscalevmgroup = apiclient.listAutoScaleVmGroups(cmd)
         return map(lambda e: AutoScaleVmGroup(e.__dict__), autoscalevmgroup)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateAutoScaleVmGroup.updateAutoScaleVmGroupCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         autoscalevmgroup = apiclient.updateAutoScaleVmGroup(cmd)
+        return autoscalevmgroup
 
 
     def disable(self, apiclient, id, **kwargs):
         cmd = disableAutoScaleVmGroup.disableAutoScaleVmGroupCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         autoscalevmgroup = apiclient.disableAutoScaleVmGroup(cmd)
+        return autoscalevmgroup
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteAutoScaleVmGroup.deleteAutoScaleVmGroupCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         autoscalevmgroup = apiclient.deleteAutoScaleVmGroup(cmd)
+        return autoscalevmgroup
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/AutoScaleVmProfile.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AutoScaleVmProfile.py b/tools/marvin/marvin/integration/lib/base/AutoScaleVmProfile.py
index 59c1b9e..5c21c9b 100644
--- a/tools/marvin/marvin/integration/lib/base/AutoScaleVmProfile.py
+++ b/tools/marvin/marvin/integration/lib/base/AutoScaleVmProfile.py
@@ -39,21 +39,25 @@ class AutoScaleVmProfile(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listAutoScaleVmProfiles.listAutoScaleVmProfilesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         autoscalevmprofile = apiclient.listAutoScaleVmProfiles(cmd)
         return map(lambda e: AutoScaleVmProfile(e.__dict__), autoscalevmprofile)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateAutoScaleVmProfile.updateAutoScaleVmProfileCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         autoscalevmprofile = apiclient.updateAutoScaleVmProfile(cmd)
+        return autoscalevmprofile
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteAutoScaleVmProfile.deleteAutoScaleVmProfileCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         autoscalevmprofile = apiclient.deleteAutoScaleVmProfile(cmd)
+        return autoscalevmprofile
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/BigSwitchVnsDevice.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/BigSwitchVnsDevice.py b/tools/marvin/marvin/integration/lib/base/BigSwitchVnsDevice.py
index 67b7054..5013755 100644
--- a/tools/marvin/marvin/integration/lib/base/BigSwitchVnsDevice.py
+++ b/tools/marvin/marvin/integration/lib/base/BigSwitchVnsDevice.py
@@ -28,22 +28,27 @@ class BigSwitchVnsDevice(CloudStackEntity.CloudStackEntity):
 
     def add(self, apiclient, physicalnetworkid, hostname, **kwargs):
         cmd = addBigSwitchVnsDevice.addBigSwitchVnsDeviceCmd()
+        cmd.id = self.id
         cmd.hostname = hostname
         cmd.physicalnetworkid = physicalnetworkid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         bigswitchvnsdevice = apiclient.addBigSwitchVnsDevice(cmd)
+        return bigswitchvnsdevice
 
 
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listBigSwitchVnsDevices.listBigSwitchVnsDevicesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         bigswitchvnsdevice = apiclient.listBigSwitchVnsDevices(cmd)
         return map(lambda e: BigSwitchVnsDevice(e.__dict__), bigswitchvnsdevice)
 
 
     def delete(self, apiclient, vnsdeviceid, **kwargs):
         cmd = deleteBigSwitchVnsDevice.deleteBigSwitchVnsDeviceCmd()
+        cmd.id = self.id
         cmd.vnsdeviceid = vnsdeviceid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         bigswitchvnsdevice = apiclient.deleteBigSwitchVnsDevice(cmd)
+        return bigswitchvnsdevice
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Capabilities.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Capabilities.py b/tools/marvin/marvin/integration/lib/base/Capabilities.py
index 6c35852..c7d1cf5 100644
--- a/tools/marvin/marvin/integration/lib/base/Capabilities.py
+++ b/tools/marvin/marvin/integration/lib/base/Capabilities.py
@@ -27,7 +27,7 @@ class Capabilities(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listCapabilities.listCapabilitiesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         capabilities = apiclient.listCapabilities(cmd)
         return map(lambda e: Capabilities(e.__dict__), capabilities)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Capacity.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Capacity.py b/tools/marvin/marvin/integration/lib/base/Capacity.py
index a989766..507524b 100644
--- a/tools/marvin/marvin/integration/lib/base/Capacity.py
+++ b/tools/marvin/marvin/integration/lib/base/Capacity.py
@@ -27,7 +27,7 @@ class Capacity(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listCapacity.listCapacityCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         capacity = apiclient.listCapacity(cmd)
         return map(lambda e: Capacity(e.__dict__), capacity)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/CloudIdentifier.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/CloudIdentifier.py b/tools/marvin/marvin/integration/lib/base/CloudIdentifier.py
index ed2dd6e..827b6bf 100644
--- a/tools/marvin/marvin/integration/lib/base/CloudIdentifier.py
+++ b/tools/marvin/marvin/integration/lib/base/CloudIdentifier.py
@@ -24,13 +24,11 @@ class CloudIdentifier(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def get(self, apiclient, userid, **kwargs):
         cmd = getCloudIdentifier.getCloudIdentifierCmd()
+        cmd.id = self.id
         cmd.userid = userid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         cloudidentifier = apiclient.getCloudIdentifier(cmd)
+        return cloudidentifier
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Cluster.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Cluster.py b/tools/marvin/marvin/integration/lib/base/Cluster.py
index 5ffae21..3808bf8 100644
--- a/tools/marvin/marvin/integration/lib/base/Cluster.py
+++ b/tools/marvin/marvin/integration/lib/base/Cluster.py
@@ -29,33 +29,39 @@ class Cluster(CloudStackEntity.CloudStackEntity):
 
     def add(self, apiclient, clustername, hypervisor, zoneid, clustertype, podid, **kwargs):
         cmd = addCluster.addClusterCmd()
+        cmd.id = self.id
         cmd.clustername = clustername
         cmd.clustertype = clustertype
         cmd.hypervisor = hypervisor
         cmd.podid = podid
         cmd.zoneid = zoneid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         cluster = apiclient.addCluster(cmd)
+        return cluster
 
 
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listClusters.listClustersCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         cluster = apiclient.listClusters(cmd)
         return map(lambda e: Cluster(e.__dict__), cluster)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateCluster.updateClusterCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         cluster = apiclient.updateCluster(cmd)
+        return cluster
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteCluster.deleteClusterCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         cluster = apiclient.deleteCluster(cmd)
+        return cluster
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Condition.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Condition.py b/tools/marvin/marvin/integration/lib/base/Condition.py
index c3189be..8d841f8 100644
--- a/tools/marvin/marvin/integration/lib/base/Condition.py
+++ b/tools/marvin/marvin/integration/lib/base/Condition.py
@@ -38,14 +38,16 @@ class Condition(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listConditions.listConditionsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         condition = apiclient.listConditions(cmd)
         return map(lambda e: Condition(e.__dict__), condition)
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteCondition.deleteConditionCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         condition = apiclient.deleteCondition(cmd)
+        return condition
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Config.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Config.py b/tools/marvin/marvin/integration/lib/base/Config.py
index 304c4f9..11d3a7b 100644
--- a/tools/marvin/marvin/integration/lib/base/Config.py
+++ b/tools/marvin/marvin/integration/lib/base/Config.py
@@ -26,6 +26,8 @@ class Config(CloudStackEntity.CloudStackEntity):
 
     def ldap(self, apiclient, **kwargs):
         cmd = ldapConfig.ldapConfigCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         config = apiclient.ldapConfig(cmd)
+        return config
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Configuration.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Configuration.py b/tools/marvin/marvin/integration/lib/base/Configuration.py
index 090bbc0..3968e15 100644
--- a/tools/marvin/marvin/integration/lib/base/Configuration.py
+++ b/tools/marvin/marvin/integration/lib/base/Configuration.py
@@ -28,14 +28,16 @@ class Configuration(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listConfigurations.listConfigurationsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         configuration = apiclient.listConfigurations(cmd)
         return map(lambda e: Configuration(e.__dict__), configuration)
 
 
     def update(self, apiclient, name, **kwargs):
         cmd = updateConfiguration.updateConfigurationCmd()
+        cmd.id = self.id
         cmd.name = name
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         configuration = apiclient.updateConfiguration(cmd)
+        return configuration
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Counter.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Counter.py b/tools/marvin/marvin/integration/lib/base/Counter.py
index 698fc7f..932182f 100644
--- a/tools/marvin/marvin/integration/lib/base/Counter.py
+++ b/tools/marvin/marvin/integration/lib/base/Counter.py
@@ -38,14 +38,16 @@ class Counter(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listCounters.listCountersCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         counter = apiclient.listCounters(cmd)
         return map(lambda e: Counter(e.__dict__), counter)
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteCounter.deleteCounterCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         counter = apiclient.deleteCounter(cmd)
+        return counter
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/CustomCertificate.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/CustomCertificate.py b/tools/marvin/marvin/integration/lib/base/CustomCertificate.py
index c9a2dbf..6e56004 100644
--- a/tools/marvin/marvin/integration/lib/base/CustomCertificate.py
+++ b/tools/marvin/marvin/integration/lib/base/CustomCertificate.py
@@ -24,14 +24,12 @@ class CustomCertificate(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def upload(self, apiclient, domainsuffix, certificate, **kwargs):
         cmd = uploadCustomCertificate.uploadCustomCertificateCmd()
+        cmd.id = self.id
         cmd.certificate = certificate
         cmd.domainsuffix = domainsuffix
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         customcertificate = apiclient.uploadCustomCertificate(cmd)
+        return customcertificate
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/DefaultNicForVirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/DefaultNicForVirtualMachine.py b/tools/marvin/marvin/integration/lib/base/DefaultNicForVirtualMachine.py
index 2d85219..0d227c1 100644
--- a/tools/marvin/marvin/integration/lib/base/DefaultNicForVirtualMachine.py
+++ b/tools/marvin/marvin/integration/lib/base/DefaultNicForVirtualMachine.py
@@ -26,7 +26,10 @@ class DefaultNicForVirtualMachine(CloudStackEntity.CloudStackEntity):
 
     def update(self, apiclient, nicid, virtualmachineid, **kwargs):
         cmd = updateDefaultNicForVirtualMachine.updateDefaultNicForVirtualMachineCmd()
+        cmd.id = self.id
         cmd.nicid = nicid
         cmd.virtualmachineid = virtualmachineid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         defaultnicforvirtualmachine = apiclient.updateDefaultNicForVirtualMachine(cmd)
+        return defaultnicforvirtualmachine
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/DefaultZoneForAccount.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/DefaultZoneForAccount.py b/tools/marvin/marvin/integration/lib/base/DefaultZoneForAccount.py
index 86e3469..f9f11ea 100644
--- a/tools/marvin/marvin/integration/lib/base/DefaultZoneForAccount.py
+++ b/tools/marvin/marvin/integration/lib/base/DefaultZoneForAccount.py
@@ -24,15 +24,13 @@ class DefaultZoneForAccount(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def mark(self, apiclient, account, domainid, zoneid, **kwargs):
         cmd = markDefaultZoneForAccount.markDefaultZoneForAccountCmd()
+        cmd.id = self.id
         cmd.account = account
         cmd.domainid = domainid
         cmd.zoneid = zoneid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         defaultzoneforaccount = apiclient.markDefaultZoneForAccount(cmd)
+        return defaultzoneforaccount
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/DiskOffering.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/DiskOffering.py b/tools/marvin/marvin/integration/lib/base/DiskOffering.py
index 8b3095c..91a5034 100644
--- a/tools/marvin/marvin/integration/lib/base/DiskOffering.py
+++ b/tools/marvin/marvin/integration/lib/base/DiskOffering.py
@@ -39,21 +39,25 @@ class DiskOffering(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listDiskOfferings.listDiskOfferingsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         diskoffering = apiclient.listDiskOfferings(cmd)
         return map(lambda e: DiskOffering(e.__dict__), diskoffering)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateDiskOffering.updateDiskOfferingCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         diskoffering = apiclient.updateDiskOffering(cmd)
+        return diskoffering
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteDiskOffering.deleteDiskOfferingCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         diskoffering = apiclient.deleteDiskOffering(cmd)
+        return diskoffering
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Domain.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Domain.py b/tools/marvin/marvin/integration/lib/base/Domain.py
index 708c1d4..fb9539b 100644
--- a/tools/marvin/marvin/integration/lib/base/Domain.py
+++ b/tools/marvin/marvin/integration/lib/base/Domain.py
@@ -39,21 +39,25 @@ class Domain(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listDomains.listDomainsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         domain = apiclient.listDomains(cmd)
         return map(lambda e: Domain(e.__dict__), domain)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateDomain.updateDomainCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         domain = apiclient.updateDomain(cmd)
+        return domain
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteDomain.deleteDomainCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         domain = apiclient.deleteDomain(cmd)
+        return domain
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/DomainChildren.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/DomainChildren.py b/tools/marvin/marvin/integration/lib/base/DomainChildren.py
index a27ec0a..de96b4c 100644
--- a/tools/marvin/marvin/integration/lib/base/DomainChildren.py
+++ b/tools/marvin/marvin/integration/lib/base/DomainChildren.py
@@ -27,7 +27,7 @@ class DomainChildren(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listDomainChildren.listDomainChildrenCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         domainchildren = apiclient.listDomainChildren(cmd)
         return map(lambda e: DomainChildren(e.__dict__), domainchildren)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/EgressFirewallRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/EgressFirewallRule.py b/tools/marvin/marvin/integration/lib/base/EgressFirewallRule.py
index 998e0b4..4b37c14 100644
--- a/tools/marvin/marvin/integration/lib/base/EgressFirewallRule.py
+++ b/tools/marvin/marvin/integration/lib/base/EgressFirewallRule.py
@@ -38,13 +38,16 @@ class EgressFirewallRule(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listEgressFirewallRules.listEgressFirewallRulesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         egressfirewallrule = apiclient.listEgressFirewallRules(cmd)
         return map(lambda e: EgressFirewallRule(e.__dict__), egressfirewallrule)
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteEgressFirewallRule.deleteEgressFirewallRuleCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         egressfirewallrule = apiclient.deleteEgressFirewallRule(cmd)
+        return egressfirewallrule
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/EventTypes.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/EventTypes.py b/tools/marvin/marvin/integration/lib/base/EventTypes.py
index 4a9e7df..978d6e4 100644
--- a/tools/marvin/marvin/integration/lib/base/EventTypes.py
+++ b/tools/marvin/marvin/integration/lib/base/EventTypes.py
@@ -27,7 +27,7 @@ class EventTypes(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listEventTypes.listEventTypesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         eventtypes = apiclient.listEventTypes(cmd)
         return map(lambda e: EventTypes(e.__dict__), eventtypes)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Events.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Events.py b/tools/marvin/marvin/integration/lib/base/Events.py
index 935c6aa..c341838 100644
--- a/tools/marvin/marvin/integration/lib/base/Events.py
+++ b/tools/marvin/marvin/integration/lib/base/Events.py
@@ -28,12 +28,15 @@ class Events(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listEvents.listEventsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         events = apiclient.listEvents(cmd)
         return map(lambda e: Events(e.__dict__), events)
 
 
     def delete(self, apiclient, **kwargs):
         cmd = deleteEvents.deleteEventsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         events = apiclient.deleteEvents(cmd)
+        return events
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/FirewallRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/FirewallRule.py b/tools/marvin/marvin/integration/lib/base/FirewallRule.py
index e456093..a61fb7c 100644
--- a/tools/marvin/marvin/integration/lib/base/FirewallRule.py
+++ b/tools/marvin/marvin/integration/lib/base/FirewallRule.py
@@ -38,14 +38,16 @@ class FirewallRule(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listFirewallRules.listFirewallRulesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         firewallrule = apiclient.listFirewallRules(cmd)
         return map(lambda e: FirewallRule(e.__dict__), firewallrule)
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteFirewallRule.deleteFirewallRuleCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         firewallrule = apiclient.deleteFirewallRule(cmd)
+        return firewallrule
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/FromGlobalLoadBalancerRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/FromGlobalLoadBalancerRule.py b/tools/marvin/marvin/integration/lib/base/FromGlobalLoadBalancerRule.py
new file mode 100644
index 0000000..73c7123
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/base/FromGlobalLoadBalancerRule.py
@@ -0,0 +1,34 @@
+# 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.
+from marvin.integration.lib.base import CloudStackEntity
+from marvin.cloudstackAPI import removeFromGlobalLoadBalancerRule
+
+class FromGlobalLoadBalancerRule(CloudStackEntity.CloudStackEntity):
+
+
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
+    def remove(self, apiclient, loadbalancerrulelist, id, **kwargs):
+        cmd = removeFromGlobalLoadBalancerRule.removeFromGlobalLoadBalancerRuleCmd()
+        cmd.id = self.id
+        cmd.id = id
+        cmd.loadbalancerrulelist = loadbalancerrulelist
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        fromgloballoadbalancerrule = apiclient.removeFromGlobalLoadBalancerRule(cmd)
+        return fromgloballoadbalancerrule

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/FromLoadBalancerRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/FromLoadBalancerRule.py b/tools/marvin/marvin/integration/lib/base/FromLoadBalancerRule.py
index 114001a..352e94a 100644
--- a/tools/marvin/marvin/integration/lib/base/FromLoadBalancerRule.py
+++ b/tools/marvin/marvin/integration/lib/base/FromLoadBalancerRule.py
@@ -24,14 +24,12 @@ class FromLoadBalancerRule(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def remove(self, apiclient, id, virtualmachineids, **kwargs):
         cmd = removeFromLoadBalancerRule.removeFromLoadBalancerRuleCmd()
+        cmd.id = self.id
         cmd.id = id
         cmd.virtualmachineids = virtualmachineids
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         fromloadbalancerrule = apiclient.removeFromLoadBalancerRule(cmd)
+        return fromloadbalancerrule
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/GlobalLoadBalancerRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/GlobalLoadBalancerRule.py b/tools/marvin/marvin/integration/lib/base/GlobalLoadBalancerRule.py
new file mode 100644
index 0000000..320d144
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/base/GlobalLoadBalancerRule.py
@@ -0,0 +1,62 @@
+# 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.
+from marvin.integration.lib.base import CloudStackEntity
+from marvin.cloudstackAPI import createGlobalLoadBalancerRule
+from marvin.cloudstackAPI import listGlobalLoadBalancerRules
+from marvin.cloudstackAPI import updateGlobalLoadBalancerRule
+from marvin.cloudstackAPI import deleteGlobalLoadBalancerRule
+
+class GlobalLoadBalancerRule(CloudStackEntity.CloudStackEntity):
+
+
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
+    @classmethod
+    def create(cls, apiclient, GlobalLoadBalancerRuleFactory, **kwargs):
+        cmd = createGlobalLoadBalancerRule.createGlobalLoadBalancerRuleCmd()
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in GlobalLoadBalancerRuleFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        globalloadbalancerrule = apiclient.createGlobalLoadBalancerRule(cmd)
+        return GlobalLoadBalancerRule(globalloadbalancerrule.__dict__)
+
+
+    @classmethod
+    def list(self, apiclient, **kwargs):
+        cmd = listGlobalLoadBalancerRules.listGlobalLoadBalancerRulesCmd()
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        globalloadbalancerrule = apiclient.listGlobalLoadBalancerRules(cmd)
+        return map(lambda e: GlobalLoadBalancerRule(e.__dict__), globalloadbalancerrule)
+
+
+    def update(self, apiclient, id, **kwargs):
+        cmd = updateGlobalLoadBalancerRule.updateGlobalLoadBalancerRuleCmd()
+        cmd.id = self.id
+        cmd.id = id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        globalloadbalancerrule = apiclient.updateGlobalLoadBalancerRule(cmd)
+        return globalloadbalancerrule
+
+
+    def delete(self, apiclient, id, **kwargs):
+        cmd = deleteGlobalLoadBalancerRule.deleteGlobalLoadBalancerRuleCmd()
+        cmd.id = self.id
+        cmd.id = id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        globalloadbalancerrule = apiclient.deleteGlobalLoadBalancerRule(cmd)
+        return globalloadbalancerrule

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Host.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Host.py b/tools/marvin/marvin/integration/lib/base/Host.py
index 2c1f23b..66d77eb 100644
--- a/tools/marvin/marvin/integration/lib/base/Host.py
+++ b/tools/marvin/marvin/integration/lib/base/Host.py
@@ -30,41 +30,49 @@ class Host(CloudStackEntity.CloudStackEntity):
 
     def add(self, apiclient, username, podid, url, hypervisor, zoneid, password, **kwargs):
         cmd = addHost.addHostCmd()
+        cmd.id = self.id
         cmd.hypervisor = hypervisor
         cmd.password = password
         cmd.podid = podid
         cmd.url = url
         cmd.username = username
         cmd.zoneid = zoneid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         host = apiclient.addHost(cmd)
+        return host
 
 
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listHosts.listHostsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         host = apiclient.listHosts(cmd)
         return map(lambda e: Host(e.__dict__), host)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateHost.updateHostCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         host = apiclient.updateHost(cmd)
+        return host
 
 
     def reconnect(self, apiclient, id, **kwargs):
         cmd = reconnectHost.reconnectHostCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         host = apiclient.reconnectHost(cmd)
+        return host
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteHost.deleteHostCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         host = apiclient.deleteHost(cmd)
+        return host
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/HostForMaintenance.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/HostForMaintenance.py b/tools/marvin/marvin/integration/lib/base/HostForMaintenance.py
index 6aaefee..05861a0 100644
--- a/tools/marvin/marvin/integration/lib/base/HostForMaintenance.py
+++ b/tools/marvin/marvin/integration/lib/base/HostForMaintenance.py
@@ -24,13 +24,11 @@ class HostForMaintenance(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def prepare(self, apiclient, id, **kwargs):
         cmd = prepareHostForMaintenance.prepareHostForMaintenanceCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         hostformaintenance = apiclient.prepareHostForMaintenance(cmd)
+        return hostformaintenance
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/HostMaintenance.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/HostMaintenance.py b/tools/marvin/marvin/integration/lib/base/HostMaintenance.py
index c28afd0..0ea8689 100644
--- a/tools/marvin/marvin/integration/lib/base/HostMaintenance.py
+++ b/tools/marvin/marvin/integration/lib/base/HostMaintenance.py
@@ -24,13 +24,11 @@ class HostMaintenance(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def cancel(self, apiclient, id, **kwargs):
         cmd = cancelHostMaintenance.cancelHostMaintenanceCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         hostmaintenance = apiclient.cancelHostMaintenance(cmd)
+        return hostmaintenance
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/HostPassword.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/HostPassword.py b/tools/marvin/marvin/integration/lib/base/HostPassword.py
index a1814a0..93d9636 100644
--- a/tools/marvin/marvin/integration/lib/base/HostPassword.py
+++ b/tools/marvin/marvin/integration/lib/base/HostPassword.py
@@ -24,14 +24,12 @@ class HostPassword(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def update(self, apiclient, username, password, **kwargs):
         cmd = updateHostPassword.updateHostPasswordCmd()
+        cmd.id = self.id
         cmd.password = password
         cmd.username = username
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         hostpassword = apiclient.updateHostPassword(cmd)
+        return hostpassword
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/HypervisorCapabilities.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/HypervisorCapabilities.py b/tools/marvin/marvin/integration/lib/base/HypervisorCapabilities.py
index 6b639b3..2c8f834 100644
--- a/tools/marvin/marvin/integration/lib/base/HypervisorCapabilities.py
+++ b/tools/marvin/marvin/integration/lib/base/HypervisorCapabilities.py
@@ -28,13 +28,15 @@ class HypervisorCapabilities(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listHypervisorCapabilities.listHypervisorCapabilitiesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         hypervisorcapabilities = apiclient.listHypervisorCapabilities(cmd)
         return map(lambda e: HypervisorCapabilities(e.__dict__), hypervisorcapabilities)
 
 
     def update(self, apiclient, **kwargs):
         cmd = updateHypervisorCapabilities.updateHypervisorCapabilitiesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         hypervisorcapabilities = apiclient.updateHypervisorCapabilities(cmd)
+        return hypervisorcapabilities
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Hypervisors.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Hypervisors.py b/tools/marvin/marvin/integration/lib/base/Hypervisors.py
index ae63ba1..b3a7960 100644
--- a/tools/marvin/marvin/integration/lib/base/Hypervisors.py
+++ b/tools/marvin/marvin/integration/lib/base/Hypervisors.py
@@ -27,7 +27,7 @@ class Hypervisors(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listHypervisors.listHypervisorsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         hypervisors = apiclient.listHypervisors(cmd)
         return map(lambda e: Hypervisors(e.__dict__), hypervisors)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/InstanceGroup.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/InstanceGroup.py b/tools/marvin/marvin/integration/lib/base/InstanceGroup.py
index d4c6bd1..7ba626f 100644
--- a/tools/marvin/marvin/integration/lib/base/InstanceGroup.py
+++ b/tools/marvin/marvin/integration/lib/base/InstanceGroup.py
@@ -39,21 +39,25 @@ class InstanceGroup(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listInstanceGroups.listInstanceGroupsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         instancegroup = apiclient.listInstanceGroups(cmd)
         return map(lambda e: InstanceGroup(e.__dict__), instancegroup)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateInstanceGroup.updateInstanceGroupCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         instancegroup = apiclient.updateInstanceGroup(cmd)
+        return instancegroup
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteInstanceGroup.deleteInstanceGroupCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         instancegroup = apiclient.deleteInstanceGroup(cmd)
+        return instancegroup
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/IpAddress.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/IpAddress.py b/tools/marvin/marvin/integration/lib/base/IpAddress.py
index 334c747..8d34597 100644
--- a/tools/marvin/marvin/integration/lib/base/IpAddress.py
+++ b/tools/marvin/marvin/integration/lib/base/IpAddress.py
@@ -25,19 +25,19 @@ class IpAddress(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def disassociate(self, apiclient, id, **kwargs):
         cmd = disassociateIpAddress.disassociateIpAddressCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         ipaddress = apiclient.disassociateIpAddress(cmd)
+        return ipaddress
 
 
     def associate(self, apiclient, **kwargs):
         cmd = associateIpAddress.associateIpAddressCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         ipaddress = apiclient.associateIpAddress(cmd)
+        return ipaddress
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/IpForwardingRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/IpForwardingRule.py b/tools/marvin/marvin/integration/lib/base/IpForwardingRule.py
index 1fbc801..d60ab65 100644
--- a/tools/marvin/marvin/integration/lib/base/IpForwardingRule.py
+++ b/tools/marvin/marvin/integration/lib/base/IpForwardingRule.py
@@ -38,14 +38,16 @@ class IpForwardingRule(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listIpForwardingRules.listIpForwardingRulesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         ipforwardingrule = apiclient.listIpForwardingRules(cmd)
         return map(lambda e: IpForwardingRule(e.__dict__), ipforwardingrule)
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteIpForwardingRule.deleteIpForwardingRuleCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         ipforwardingrule = apiclient.deleteIpForwardingRule(cmd)
+        return ipforwardingrule
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/IpFromNic.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/IpFromNic.py b/tools/marvin/marvin/integration/lib/base/IpFromNic.py
index ef5d905..b07acea 100644
--- a/tools/marvin/marvin/integration/lib/base/IpFromNic.py
+++ b/tools/marvin/marvin/integration/lib/base/IpFromNic.py
@@ -26,6 +26,9 @@ class IpFromNic(CloudStackEntity.CloudStackEntity):
 
     def remove(self, apiclient, id, **kwargs):
         cmd = removeIpFromNic.removeIpFromNicCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         ipfromnic = apiclient.removeIpFromNic(cmd)
+        return ipfromnic
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/IpToNic.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/IpToNic.py b/tools/marvin/marvin/integration/lib/base/IpToNic.py
index dc95db4..74d434d 100644
--- a/tools/marvin/marvin/integration/lib/base/IpToNic.py
+++ b/tools/marvin/marvin/integration/lib/base/IpToNic.py
@@ -26,6 +26,9 @@ class IpToNic(CloudStackEntity.CloudStackEntity):
 
     def add(self, apiclient, nicid, **kwargs):
         cmd = addIpToNic.addIpToNicCmd()
+        cmd.id = self.id
         cmd.nicid = nicid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         iptonic = apiclient.addIpToNic(cmd)
+        return iptonic
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Iso.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Iso.py b/tools/marvin/marvin/integration/lib/base/Iso.py
index 8cf6bef..6129d8f 100644
--- a/tools/marvin/marvin/integration/lib/base/Iso.py
+++ b/tools/marvin/marvin/integration/lib/base/Iso.py
@@ -33,64 +33,78 @@ class Iso(CloudStackEntity.CloudStackEntity):
 
     def copy(self, apiclient, sourcezoneid, id, destzoneid, **kwargs):
         cmd = copyIso.copyIsoCmd()
+        cmd.id = self.id
         cmd.id = id
         cmd.destzoneid = destzoneid
         cmd.sourcezoneid = sourcezoneid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         iso = apiclient.copyIso(cmd)
+        return iso
 
 
     def register(self, apiclient, url, displaytext, name, zoneid, **kwargs):
         cmd = registerIso.registerIsoCmd()
+        cmd.id = self.id
         cmd.displaytext = displaytext
         cmd.name = name
         cmd.url = url
         cmd.zoneid = zoneid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         iso = apiclient.registerIso(cmd)
+        return iso
 
 
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listIsos.listIsosCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         iso = apiclient.listIsos(cmd)
         return map(lambda e: Iso(e.__dict__), iso)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateIso.updateIsoCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         iso = apiclient.updateIso(cmd)
+        return iso
 
 
     def attach(self, apiclient, id, virtualmachineid, **kwargs):
         cmd = attachIso.attachIsoCmd()
+        cmd.id = self.id
         cmd.id = id
         cmd.virtualmachineid = virtualmachineid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         iso = apiclient.attachIso(cmd)
+        return iso
 
 
     def detach(self, apiclient, virtualmachineid, **kwargs):
         cmd = detachIso.detachIsoCmd()
+        cmd.id = self.id
         cmd.virtualmachineid = virtualmachineid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         iso = apiclient.detachIso(cmd)
+        return iso
 
 
     def extract(self, apiclient, id, mode, **kwargs):
         cmd = extractIso.extractIsoCmd()
+        cmd.id = self.id
         cmd.id = id
         cmd.mode = mode
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         iso = apiclient.extractIso(cmd)
+        return iso
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteIso.deleteIsoCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         iso = apiclient.deleteIso(cmd)
+        return iso
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/IsoPermissions.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/IsoPermissions.py b/tools/marvin/marvin/integration/lib/base/IsoPermissions.py
index 80332bf..c669885 100644
--- a/tools/marvin/marvin/integration/lib/base/IsoPermissions.py
+++ b/tools/marvin/marvin/integration/lib/base/IsoPermissions.py
@@ -29,14 +29,16 @@ class IsoPermissions(CloudStackEntity.CloudStackEntity):
     def list(self, apiclient, id, **kwargs):
         cmd = listIsoPermissions.listIsoPermissionsCmd()
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         isopermissions = apiclient.listIsoPermissions(cmd)
         return map(lambda e: IsoPermissions(e.__dict__), isopermissions)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateIsoPermissions.updateIsoPermissionsCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         isopermissions = apiclient.updateIsoPermissions(cmd)
+        return isopermissions
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/LBHealthCheckPolicies.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/LBHealthCheckPolicies.py b/tools/marvin/marvin/integration/lib/base/LBHealthCheckPolicies.py
new file mode 100644
index 0000000..a2a79e1
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/base/LBHealthCheckPolicies.py
@@ -0,0 +1,33 @@
+# 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.
+from marvin.integration.lib.base import CloudStackEntity
+from marvin.cloudstackAPI import listLBHealthCheckPolicies
+
+class LBHealthCheckPolicies(CloudStackEntity.CloudStackEntity):
+
+
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
+    @classmethod
+    def list(self, apiclient, lbruleid, **kwargs):
+        cmd = listLBHealthCheckPolicies.listLBHealthCheckPoliciesCmd()
+        cmd.lbruleid = lbruleid
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        lbhealthcheckpolicies = apiclient.listLBHealthCheckPolicies(cmd)
+        return map(lambda e: LBHealthCheckPolicies(e.__dict__), lbhealthcheckpolicies)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/LBHealthCheckPolicy.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/LBHealthCheckPolicy.py b/tools/marvin/marvin/integration/lib/base/LBHealthCheckPolicy.py
new file mode 100644
index 0000000..e6b10a3
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/base/LBHealthCheckPolicy.py
@@ -0,0 +1,43 @@
+# 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.
+from marvin.integration.lib.base import CloudStackEntity
+from marvin.cloudstackAPI import createLBHealthCheckPolicy
+from marvin.cloudstackAPI import deleteLBHealthCheckPolicy
+
+class LBHealthCheckPolicy(CloudStackEntity.CloudStackEntity):
+
+
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
+    @classmethod
+    def create(cls, apiclient, LBHealthCheckPolicyFactory, **kwargs):
+        cmd = createLBHealthCheckPolicy.createLBHealthCheckPolicyCmd()
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in LBHealthCheckPolicyFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        lbhealthcheckpolicy = apiclient.createLBHealthCheckPolicy(cmd)
+        return LBHealthCheckPolicy(lbhealthcheckpolicy.__dict__)
+
+
+    def delete(self, apiclient, id, **kwargs):
+        cmd = deleteLBHealthCheckPolicy.deleteLBHealthCheckPolicyCmd()
+        cmd.id = self.id
+        cmd.id = id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        lbhealthcheckpolicy = apiclient.deleteLBHealthCheckPolicy(cmd)
+        return lbhealthcheckpolicy

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/LBStickinessPolicies.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/LBStickinessPolicies.py b/tools/marvin/marvin/integration/lib/base/LBStickinessPolicies.py
index 59f7bf1..dc9b520 100644
--- a/tools/marvin/marvin/integration/lib/base/LBStickinessPolicies.py
+++ b/tools/marvin/marvin/integration/lib/base/LBStickinessPolicies.py
@@ -28,7 +28,7 @@ class LBStickinessPolicies(CloudStackEntity.CloudStackEntity):
     def list(self, apiclient, lbruleid, **kwargs):
         cmd = listLBStickinessPolicies.listLBStickinessPoliciesCmd()
         cmd.lbruleid = lbruleid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         lbstickinesspolicies = apiclient.listLBStickinessPolicies(cmd)
         return map(lambda e: LBStickinessPolicies(e.__dict__), lbstickinesspolicies)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/LBStickinessPolicy.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/LBStickinessPolicy.py b/tools/marvin/marvin/integration/lib/base/LBStickinessPolicy.py
index 1550b22..3d88f05 100644
--- a/tools/marvin/marvin/integration/lib/base/LBStickinessPolicy.py
+++ b/tools/marvin/marvin/integration/lib/base/LBStickinessPolicy.py
@@ -36,7 +36,9 @@ class LBStickinessPolicy(CloudStackEntity.CloudStackEntity):
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteLBStickinessPolicy.deleteLBStickinessPolicyCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         lbstickinesspolicy = apiclient.deleteLBStickinessPolicy(cmd)
+        return lbstickinesspolicy
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/LoadBalancerRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/LoadBalancerRule.py b/tools/marvin/marvin/integration/lib/base/LoadBalancerRule.py
index 3dbf6fd..b386ae1 100644
--- a/tools/marvin/marvin/integration/lib/base/LoadBalancerRule.py
+++ b/tools/marvin/marvin/integration/lib/base/LoadBalancerRule.py
@@ -39,21 +39,25 @@ class LoadBalancerRule(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listLoadBalancerRules.listLoadBalancerRulesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         loadbalancerrule = apiclient.listLoadBalancerRules(cmd)
         return map(lambda e: LoadBalancerRule(e.__dict__), loadbalancerrule)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateLoadBalancerRule.updateLoadBalancerRuleCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         loadbalancerrule = apiclient.updateLoadBalancerRule(cmd)
+        return loadbalancerrule
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteLoadBalancerRule.deleteLoadBalancerRuleCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         loadbalancerrule = apiclient.deleteLoadBalancerRule(cmd)
+        return loadbalancerrule
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/LoadBalancerRuleInstances.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/LoadBalancerRuleInstances.py b/tools/marvin/marvin/integration/lib/base/LoadBalancerRuleInstances.py
index ff8bc34..07a2fe1 100644
--- a/tools/marvin/marvin/integration/lib/base/LoadBalancerRuleInstances.py
+++ b/tools/marvin/marvin/integration/lib/base/LoadBalancerRuleInstances.py
@@ -28,7 +28,7 @@ class LoadBalancerRuleInstances(CloudStackEntity.CloudStackEntity):
     def list(self, apiclient, id, **kwargs):
         cmd = listLoadBalancerRuleInstances.listLoadBalancerRuleInstancesCmd()
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         loadbalancerruleinstances = apiclient.listLoadBalancerRuleInstances(cmd)
         return map(lambda e: LoadBalancerRuleInstances(e.__dict__), loadbalancerruleinstances)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Network.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Network.py b/tools/marvin/marvin/integration/lib/base/Network.py
index 1fc2a16..c7e026d 100644
--- a/tools/marvin/marvin/integration/lib/base/Network.py
+++ b/tools/marvin/marvin/integration/lib/base/Network.py
@@ -40,28 +40,34 @@ class Network(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listNetworks.listNetworksCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         network = apiclient.listNetworks(cmd)
         return map(lambda e: Network(e.__dict__), network)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateNetwork.updateNetworkCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         network = apiclient.updateNetwork(cmd)
+        return network
 
 
     def restart(self, apiclient, id, **kwargs):
         cmd = restartNetwork.restartNetworkCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         network = apiclient.restartNetwork(cmd)
+        return network
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteNetwork.deleteNetworkCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         network = apiclient.deleteNetwork(cmd)
+        return network
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/NetworkACL.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/NetworkACL.py b/tools/marvin/marvin/integration/lib/base/NetworkACL.py
index dcdf117..76b8bd7 100644
--- a/tools/marvin/marvin/integration/lib/base/NetworkACL.py
+++ b/tools/marvin/marvin/integration/lib/base/NetworkACL.py
@@ -38,14 +38,16 @@ class NetworkACL(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listNetworkACLs.listNetworkACLsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         networkacl = apiclient.listNetworkACLs(cmd)
         return map(lambda e: NetworkACL(e.__dict__), networkacl)
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteNetworkACL.deleteNetworkACLCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         networkacl = apiclient.deleteNetworkACL(cmd)
+        return networkacl
 


[19/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
CLOUDSTACK-1771: fixed VirtualRouter nics assignment in the Shared networks. Before the fix VR could get a different IP address from the network upon recreation. With the fix the IP address assigned to the first VR in the network, will remain with the network till its entire lifecycle (stored in placeholder nic) and will be assigned to the VR every time it recreates in the network.
Shared networks in both - Advance and Basic - zone types are covered by this checkin


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

Branch: refs/heads/marvin_refactor
Commit: 70566dd3e4b7ba31b44144ff8b411cbd59531d50
Parents: f4fad9e
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Mon Mar 25 16:34:04 2013 -0700
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:05:04 2013 +0530

----------------------------------------------------------------------
 api/src/com/cloud/network/NetworkModel.java        |    2 -
 .../network/ExternalFirewallDeviceManagerImpl.java |    2 +-
 server/src/com/cloud/network/NetworkManager.java   |    4 +-
 .../src/com/cloud/network/NetworkManagerImpl.java  |  104 ++++++---------
 server/src/com/cloud/network/NetworkModelImpl.java |   33 +----
 .../com/cloud/network/guru/DirectNetworkGuru.java  |   10 +-
 .../network/guru/DirectPodBasedNetworkGuru.java    |    8 +-
 .../router/VirtualNetworkApplianceManagerImpl.java |   53 +++----
 .../src/com/cloud/upgrade/dao/Upgrade410to420.java |   45 +------
 server/src/com/cloud/vm/dao/NicDao.java            |    4 +-
 .../com/cloud/network/MockNetworkModelImpl.java    |    6 -
 .../test/com/cloud/vpc/MockNetworkModelImpl.java   |    6 -
 12 files changed, 90 insertions(+), 187 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/70566dd3/api/src/com/cloud/network/NetworkModel.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/NetworkModel.java b/api/src/com/cloud/network/NetworkModel.java
index c1f1674..916f28a 100644
--- a/api/src/com/cloud/network/NetworkModel.java
+++ b/api/src/com/cloud/network/NetworkModel.java
@@ -261,6 +261,4 @@ public interface NetworkModel {
 	String getStartIpv6Address(long id);
 
     Nic getPlaceholderNic(Network network, Long podId);
-
-    boolean isProviderEnabledInZone(long zoneId, String provider);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/70566dd3/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java b/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
index ae00bf2..d0ef1bd 100644
--- a/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
+++ b/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
@@ -428,7 +428,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
         IPAddressVO sourceNatIp = null;
         if (!sharedSourceNat) {
             // Get the source NAT IP address for this account          
-            List<? extends IpAddress> sourceNatIps = _networkModel.listPublicIpsAssignedToAccount(network.getAccountId(), 
+            List<? extends IpAddress> sourceNatIps = _networkModel.listPublicIpsAssignedToAccount(network.getAccountId(),
                     zoneId, true);
 
             if (sourceNatIps.size() != 1) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/70566dd3/server/src/com/cloud/network/NetworkManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManager.java b/server/src/com/cloud/network/NetworkManager.java
index 851f7f5..e961f04 100755
--- a/server/src/com/cloud/network/NetworkManager.java
+++ b/server/src/com/cloud/network/NetworkManager.java
@@ -20,8 +20,8 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.cloudstack.acl.ControlledEntity.ACLType;
-
 import com.cloud.dc.DataCenter;
+import com.cloud.dc.DataCenterVO;
 import com.cloud.dc.Pod;
 import com.cloud.dc.Vlan.VlanType;
 import com.cloud.deploy.DataCenterDeployment;
@@ -51,11 +51,13 @@ import com.cloud.user.User;
 import com.cloud.utils.Pair;
 import com.cloud.vm.Nic;
 import com.cloud.vm.NicProfile;
+import com.cloud.vm.NicSecondaryIp;
 import com.cloud.vm.NicVO;
 import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VMInstanceVO;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
+import com.cloud.vm.VirtualMachineProfileImpl;
 
 /**
  * NetworkManager manages the network for the different end users.

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/70566dd3/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java
index c0685ba..226bf05 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -243,41 +243,16 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
     @Inject
     PodVlanMapDao _podVlanMapDao;
 
+    @Inject 
     List<NetworkGuru> _networkGurus;
-    public List<NetworkGuru> getNetworkGurus() {
-		return _networkGurus;
-	}
-	public void setNetworkGurus(List<NetworkGuru> _networkGurus) {
-		this._networkGurus = _networkGurus;
-	}
-
-	List<NetworkElement> _networkElements;
-    public List<NetworkElement> getNetworkElements() {
-		return _networkElements;
-	}
-	public void setNetworkElements(List<NetworkElement> _networkElements) {
-		this._networkElements = _networkElements;
-	}
-
-	@Inject NetworkDomainDao _networkDomainDao;
-
-	List<IpDeployer> _ipDeployers;
-    public List<IpDeployer> getIpDeployers() {
-		return _ipDeployers;
-	}
-	public void setIpDeployers(List<IpDeployer> _ipDeployers) {
-		this._ipDeployers = _ipDeployers;
-	}
-
-	List<DhcpServiceProvider> _dhcpProviders;
-    public List<DhcpServiceProvider> getDhcpProviders() {
-		return _dhcpProviders;
-	}
-	public void setDhcpProviders(List<DhcpServiceProvider> _dhcpProviders) {
-		this._dhcpProviders = _dhcpProviders;
-	}
-
-	@Inject
+
+    @Inject  protected List<NetworkElement> _networkElements;
+
+    @Inject NetworkDomainDao _networkDomainDao;
+    @Inject List<IpDeployer> _ipDeployers;
+    @Inject List<DhcpServiceProvider> _dhcpProviders;
+ 
+    @Inject
     VMInstanceDao _vmDao;
     @Inject
     FirewallManager _firewallMgr;
@@ -611,10 +586,10 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
                 }
                 IpDeployer deployer = null;
                 NetworkElement element = _networkModel.getElementImplementingProvider(provider.getName());
-                if (!(element instanceof IpDeployingRequester)) {
+                if (!(ComponentContext.getTargetObject(element) instanceof IpDeployingRequester)) {
                     throw new CloudRuntimeException("Element " + element + " is not a IpDeployingRequester!");
                 }
-                deployer = ((IpDeployingRequester)element).getIpDeployer(network);
+                deployer = ((IpDeployingRequester)ComponentContext.getTargetObject(element)).getIpDeployer(network);
                 if (deployer == null) {
                     throw new CloudRuntimeException("Fail to get ip deployer for element: " + element);
                 }
@@ -1528,6 +1503,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
         // associate a source NAT IP (if one isn't already associated with the network)
 
         boolean sharedSourceNat = offering.getSharedSourceNat();
+        DataCenter zone = _dcDao.findById(network.getDataCenterId());
         if (network.getGuestType() == Network.GuestType.Isolated
                && _networkModel.areServicesSupportedInNetwork(network.getId(), Service.SourceNat)
                && !sharedSourceNat) {
@@ -1593,13 +1569,13 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
         if (vmProfile.getType() == Type.User && element.getProvider() != null) {
             if (_networkModel.areServicesSupportedInNetwork(network.getId(), Service.Dhcp) &&
                     _networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.Dhcp, element.getProvider()) &&
-                    element instanceof DhcpServiceProvider) {
+                    (ComponentContext.getTargetObject(element) instanceof DhcpServiceProvider)) {
                 DhcpServiceProvider sp = (DhcpServiceProvider) element;
                 sp.addDhcpEntry(network, profile, vmProfile, dest, context);
             }
             if (_networkModel.areServicesSupportedInNetwork(network.getId(), Service.UserData) &&
                     _networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.UserData, element.getProvider()) &&
-                    element instanceof UserDataServiceProvider) {
+                    (ComponentContext.getTargetObject(element) instanceof UserDataServiceProvider)) {
                 UserDataServiceProvider sp = (UserDataServiceProvider) element;
                 sp.addPasswordAndUserdata(network, profile, vmProfile, dest, context);
             }
@@ -2063,7 +2039,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
             userNetwork.setIp6Cidr(ip6Cidr);
             userNetwork.setIp6Gateway(ip6Gateway);
         }
-        
+
         if (vlanId != null) {
             userNetwork.setBroadcastUri(URI.create("vlan://" + vlanId));
             userNetwork.setBroadcastDomainType(BroadcastDomainType.Vlan);
@@ -3469,29 +3445,29 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
     							 String requestedIpv4, String requestedIpv6) throws InsufficientVirtualNetworkCapcityException,
             InsufficientAddressCapacityException {
     	boolean ipv4 = false, ipv6 = false;
-    	
-    	Transaction txn = Transaction.currentTxn();
+
+	Transaction txn = Transaction.currentTxn();
         txn.start();
-        
+
     	if (network.getGateway() != null) {
     		if (nic.getIp4Address() == null) {
     			ipv4 = true;
-    			PublicIp ip = null;
-    			
-    			//Get ip address from the placeholder and don't allocate a new one
-    			if (requestedIpv4 != null && vm.getType() == VirtualMachine.Type.DomainRouter) {
-    			    Nic placeholderNic = _networkModel.getPlaceholderNic(network, null);
-    			    if (placeholderNic != null) {
-    			        IPAddressVO userIp = _ipAddressDao.findByIpAndSourceNetworkId(network.getId(), placeholderNic.getIp4Address());
+			PublicIp ip = null;
+
+			//Get ip address from the placeholder and don't allocate a new one
+			if (requestedIpv4 != null && vm.getType() == VirtualMachine.Type.DomainRouter) {
+			    Nic placeholderNic = _networkModel.getPlaceholderNic(network, null);
+			    if (placeholderNic != null) {
+			        IPAddressVO userIp = _ipAddressDao.findByIpAndSourceNetworkId(network.getId(), placeholderNic.getIp4Address());
                         ip = PublicIp.createFromAddrAndVlan(userIp, _vlanDao.findById(userIp.getVlanId()));
                         s_logger.debug("Nic got an ip address " + placeholderNic.getIp4Address() + " stored in placeholder nic for the network " + network);
                     }
-    			}
-    			
-    			if (ip == null) {
+			}
+
+			if (ip == null) {
                     ip = assignPublicIpAddress(dc.getId(), null, vm.getOwner(), VlanType.DirectAttached, network.getId(), requestedIpv4, false);
-    			}
-    						
+			}
+
     			nic.setIp4Address(ip.getAddress().toString());
     			nic.setGateway(ip.getGateway());
     			nic.setNetmask(ip.getNetmask());
@@ -3506,7 +3482,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
     		nic.setDns2(dc.getDns2());
     	}
     	
-    	//FIXME - get ipv6 address from the placeholder if it's stored there
+	//FIXME - get ipv6 address from the placeholder if it's stored there
     	if (network.getIp6Gateway() != null) {
     		if (nic.getIp6Address() == null) {
     			ipv6 = true;
@@ -3529,8 +3505,8 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
     		nic.setIp6Dns1(dc.getIp6Dns1());
     		nic.setIp6Dns2(dc.getIp6Dns2());
     	}
-    	
-    	txn.commit();
+
+	txn.commit();
     }
 
 	@Override
@@ -3677,15 +3653,15 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
     @Override
     public StaticNatServiceProvider getStaticNatProviderForNetwork(Network network) {
         NetworkElement element = getElementForServiceInNetwork(network, Service.StaticNat);
-        assert element instanceof StaticNatServiceProvider;
-        return (StaticNatServiceProvider)element;
+        assert ComponentContext.getTargetObject(element) instanceof StaticNatServiceProvider;
+        return (StaticNatServiceProvider)ComponentContext.getTargetObject(element);
     }
 
     @Override
     public LoadBalancingServiceProvider getLoadBalancingProviderForNetwork(Network network) {
         NetworkElement element = getElementForServiceInNetwork(network, Service.Lb);
-        assert element instanceof LoadBalancingServiceProvider; 
-        return (LoadBalancingServiceProvider)element;
+        assert ComponentContext.getTargetObject(element) instanceof LoadBalancingServiceProvider; 
+        return ( LoadBalancingServiceProvider)ComponentContext.getTargetObject(element);
     }
     @Override
     public boolean isNetworkInlineMode(Network network) {
@@ -3734,14 +3710,14 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
             Ip ipAddr = ip.getAddress();
             return ipAddr.addr();
         }
-        
+
         @Override
         public NicVO savePlaceholderNic(Network network, String ip4Address) {
-            NicVO nic = new NicVO(null, null, network.getId(), null); 
+            NicVO nic = new NicVO(null, null, network.getId(), null);
             nic.setIp4Address(ip4Address);
             nic.setReservationStrategy(ReservationStrategy.PlaceHolder);
             nic.setState(Nic.State.Reserved);
             return _nicDao.persist(nic);
         }
-        
+
  }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/70566dd3/server/src/com/cloud/network/NetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkModelImpl.java b/server/src/com/cloud/network/NetworkModelImpl.java
index d967f33..d1326b5 100644
--- a/server/src/com/cloud/network/NetworkModelImpl.java
+++ b/server/src/com/cloud/network/NetworkModelImpl.java
@@ -143,15 +143,9 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel {
     @Inject
     PodVlanMapDao _podVlanMapDao;
 
-    List<NetworkElement> _networkElements;
-    public List<NetworkElement> getNetworkElements() {
-		return _networkElements;
-	}
-	public void setNetworkElements(List<NetworkElement> _networkElements) {
-		this._networkElements = _networkElements;
-	}
-
-	@Inject
+    @Inject List<NetworkElement> _networkElements;
+    
+    @Inject
     NetworkDomainDao _networkDomainDao;
     @Inject
     VMInstanceDao _vmDao;
@@ -404,9 +398,9 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel {
         Network network = _networksDao.findById(networkId);
         NetworkElement oldElement = getElementImplementingProvider(oldProvider.getName());
         NetworkElement newElement = getElementImplementingProvider(newProvider.getName());
-        if (oldElement instanceof IpDeployingRequester && newElement instanceof IpDeployingRequester) {
-        	IpDeployer oldIpDeployer = ((IpDeployingRequester)oldElement).getIpDeployer(network);
-        	IpDeployer newIpDeployer = ((IpDeployingRequester)newElement).getIpDeployer(network);
+        if (ComponentContext.getTargetObject(oldElement) instanceof IpDeployingRequester && ComponentContext.getTargetObject(newElement) instanceof IpDeployingRequester) {
+        	IpDeployer oldIpDeployer = ((IpDeployingRequester)ComponentContext.getTargetObject(oldElement)).getIpDeployer(network);
+        	IpDeployer newIpDeployer = ((IpDeployingRequester)ComponentContext.getTargetObject(newElement)).getIpDeployer(network);
         	if (!oldIpDeployer.getProvider().getName().equals(newIpDeployer.getProvider().getName())) {
         		throw new InvalidParameterException("There would be multiple providers for IP " + publicIp.getAddress() + "!");
         	}
@@ -1212,19 +1206,6 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel {
         }
         return isProviderEnabled(ntwkSvcProvider);
     }
-    
-    @Override
-    public boolean isProviderEnabledInZone(long zoneId, String provider)
-    {
-        //the provider has to be enabled at least in one network in the zone
-        for (PhysicalNetwork pNtwk : _physicalNetworkDao.listByZone(zoneId)) {
-            if (isProviderEnabledInPhysicalNetwork(pNtwk.getId(), provider)) {
-                return true;
-            }
-        }
-        
-        return false;
-    }
 
     @Override
     public String getNetworkTag(HypervisorType hType, Network network) {
@@ -2012,7 +1993,7 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel {
     	}
 		return startIpv6;
 	}
-	
+
     @Override
     public NicVO getPlaceholderNic(Network network, Long podId) {
         List<NicVO> nics = _nicDao.listPlaceholderNicsByNetworkId(network.getId());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/70566dd3/server/src/com/cloud/network/guru/DirectNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/DirectNetworkGuru.java b/server/src/com/cloud/network/guru/DirectNetworkGuru.java
index 2c8acbb..c53bbb7 100755
--- a/server/src/com/cloud/network/guru/DirectNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/DirectNetworkGuru.java
@@ -220,7 +220,7 @@ public class DirectNetworkGuru extends AdapterBase implements NetworkGuru {
     protected void allocateDirectIp(NicProfile nic, Network network, VirtualMachineProfile<? extends VirtualMachine> vm, DataCenter dc, String requestedIp4Addr, String requestedIp6Addr)
             throws InsufficientVirtualNetworkCapcityException,
             InsufficientAddressCapacityException {
-        
+
         //FIXME - save ipv6 informaiton in the placeholder nic
         Transaction txn = Transaction.currentTxn();
         txn.start();
@@ -257,7 +257,7 @@ public class DirectNetworkGuru extends AdapterBase implements NetworkGuru {
             if (ip != null) {
                 Transaction txn = Transaction.currentTxn();
                 txn.start();
-                
+
                 // if the ip address a part of placeholder, don't release it
                 Nic placeholderNic = _networkModel.getPlaceholderNic(network, null);
                 if (placeholderNic != null && placeholderNic.getIp4Address().equalsIgnoreCase(ip.getAddress().addr())) {
@@ -266,7 +266,7 @@ public class DirectNetworkGuru extends AdapterBase implements NetworkGuru {
                     _networkMgr.markIpAsUnavailable(ip.getId());
                     _ipAddressDao.unassignIpAddress(ip.getId());
                 }
-               
+
                 //unassign nic secondary ip address
                 s_logger.debug("remove nic " + nic.getId() + " secondary ip ");
                 List<String> nicSecIps = null;
@@ -276,7 +276,7 @@ public class DirectNetworkGuru extends AdapterBase implements NetworkGuru {
                     _networkMgr.markIpAsUnavailable(pubIp.getId());
                     _ipAddressDao.unassignIpAddress(pubIp.getId());
                 }
-    
+
                 txn.commit();
             }
     	}
@@ -308,7 +308,7 @@ public class DirectNetworkGuru extends AdapterBase implements NetworkGuru {
                 _nicDao.remove(nic.getId());
             }
         }
-        
+
         txn.commit();
         return true;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/70566dd3/server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java b/server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java
index d74cd06..8f15d5a 100755
--- a/server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java
@@ -164,7 +164,7 @@ public class DirectPodBasedNetworkGuru extends DirectNetworkGuru {
         if (nic.getIp4Address() == null) {
             Transaction txn = Transaction.currentTxn();
             txn.start();
-            
+
             PublicIp ip = null;
             List<PodVlanMapVO> podRefs = _podVlanDao.listPodVlanMapsByPod(pod.getId());
             String podRangeGateway = null;
@@ -180,11 +180,11 @@ public class DirectPodBasedNetworkGuru extends DirectNetworkGuru {
                     s_logger.debug("Nic got an ip address " + placeholderNic.getIp4Address() + " stored in placeholder nic for the network " + network + " and gateway " + podRangeGateway);
                 }
             }
-            
+
             if (ip == null) {
                 ip = _networkMgr.assignPublicIpAddress(dc.getId(), pod.getId(), vm.getOwner(), VlanType.DirectAttached, network.getId(), null, false);
             }
-            
+
             nic.setIp4Address(ip.getAddress().toString());
             nic.setFormat(AddressFormat.Ip4);
             nic.setGateway(ip.getGateway());
@@ -196,7 +196,7 @@ public class DirectPodBasedNetworkGuru extends DirectNetworkGuru {
             }
             nic.setReservationId(String.valueOf(ip.getVlanTag()));
             nic.setMacAddress(ip.getMacAddress());
-            
+
             //save the placeholder nic if the vm is the Virtual router
             if (vm.getType() == VirtualMachine.Type.DomainRouter) {
                 Nic placeholderNic = _networkModel.getPlaceholderNic(network, null);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/70566dd3/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index 67c94fc..50188e7 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -303,6 +303,8 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
     @Inject
     VpnUserDao _vpnUsersDao;
     @Inject
+    RemoteAccessVpnDao _remoteAccessVpnDao;
+    @Inject
     RulesManager _rulesMgr;
     @Inject
     NetworkDao _networkDao;
@@ -1275,22 +1277,13 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
                      * We update the router pair which the lower id router owned by this mgmt server, in order
                      * to prevent duplicate update of router status from cluster mgmt servers
                      */
-                    DomainRouterVO router0 = routers.get(0);
-                    DomainRouterVO router1 = routers.get(1);
-                    DomainRouterVO router = router0;
-                    if ((router0.getId() < router1.getId()) && router0.getHostId() != null) {
-                    	router = router0;
-                    } else {
-                    	router = router1;
-                    }
-                    if (router.getHostId() == null) {
-                    	s_logger.debug("Skip router pair (" + router0.getInstanceName() + "," + router1.getInstanceName() + ") due to can't find host");
-                    	continue;
+                    DomainRouterVO router = routers.get(0);
+                    if (routers.get(1).getId() < router.getId()) {
+                        router = routers.get(1);
                     }
                     HostVO host = _hostDao.findById(router.getHostId());
                     if (host == null || host.getManagementServerId() == null ||
                             host.getManagementServerId() != ManagementServerNode.getManagementServerId()) {
-                    	s_logger.debug("Skip router pair (" + router0.getInstanceName() + "," + router1.getInstanceName() + ") due to not belong to this mgmt server");
                         continue;
                     }
                 updateRoutersRedundantState(routers);
@@ -1706,30 +1699,30 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
             String defaultNetworkStartIp = null, defaultNetworkStartIpv6 = null;
             if (!setupPublicNetwork) {
             	if (guestNetwork.getCidr() != null) {
-            	    //Check the placeholder nic, and if it's ip address is not empty, allocate it from there
-            	    String requestedGateway = null;
-            	    if (guestNetwork.getGateway() != null) {
-            	        requestedGateway = guestNetwork.getGateway();
-            	    } else if (plan != null && plan.getPodId() != null) {
-            	        Pod pod = _configMgr.getPod(plan.getPodId());
-            	        requestedGateway = pod.getGateway();
-            	    }
-            	    Nic placeholder = _networkModel.getPlaceholderNic(guestNetwork, null);
-            	    if (placeholder != null) {
-            	        s_logger.debug("Requesting ip address " + placeholder.getIp4Address() + " stored in placeholder nic for the network " + guestNetwork);
-            	        defaultNetworkStartIp = placeholder.getIp4Address();
-            	    } else {
-            	        String startIp = _networkModel.getStartIpAddress(guestNetwork.getId());
+		    //Check the placeholder nic, and if it's ip address is not empty, allocate it from there
+		    String requestedGateway = null;
+		    if (guestNetwork.getGateway() != null) {
+		        requestedGateway = guestNetwork.getGateway();
+		    } else if (plan != null && plan.getPodId() != null) {
+		        Pod pod = _configMgr.getPod(plan.getPodId());
+		        requestedGateway = pod.getGateway();
+		    }
+		    Nic placeholder = _networkModel.getPlaceholderNic(guestNetwork, null);
+		    if (placeholder != null) {
+		        s_logger.debug("Requesting ip address " + placeholder.getIp4Address() + " stored in placeholder nic for the network " + guestNetwork);
+		        defaultNetworkStartIp = placeholder.getIp4Address();
+		    } else {
+		        String startIp = _networkModel.getStartIpAddress(guestNetwork.getId());
                         if (startIp != null && _ipAddressDao.findByIpAndSourceNetworkId(guestNetwork.getId(), startIp).getAllocatedTime() == null) {
                             defaultNetworkStartIp = startIp;
                         } else if (s_logger.isDebugEnabled()){
-                            s_logger.debug("First ip " + startIp + " in network id=" + guestNetwork.getId() + 
+                            s_logger.debug("First ip " + startIp + " in network id=" + guestNetwork.getId() +
                                     " is already allocated, can't use it for domain router; will get random ip address from the range");
                         }
-            	    }
+		    }
             	}
             	
-            	//FIXME - get ipv6 stored in the placeholder
+		//FIXME - get ipv6 stored in the placeholder
             	if (guestNetwork.getIp6Cidr() != null) {
             		String startIpv6 = _networkModel.getStartIpv6Address(guestNetwork.getId());
             		if (startIpv6 != null && _ipv6Dao.findByNetworkIdAndIp(guestNetwork.getId(), startIpv6) == null) {
@@ -2344,7 +2337,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
                 }
       
                 if (_networkModel.isProviderSupportServiceInNetwork(guestNetworkId, Service.Vpn, provider)) {
-                    RemoteAccessVpn vpn = _vpnDao.findByPublicIpAddress(ip.getId());
+                    RemoteAccessVpn vpn = _vpnDao.findById(ip.getId());
                     if (vpn != null) {
                         vpns.add(vpn);
                     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/70566dd3/server/src/com/cloud/upgrade/dao/Upgrade410to420.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/upgrade/dao/Upgrade410to420.java b/server/src/com/cloud/upgrade/dao/Upgrade410to420.java
index d26da4d..dd0aa3e 100644
--- a/server/src/com/cloud/upgrade/dao/Upgrade410to420.java
+++ b/server/src/com/cloud/upgrade/dao/Upgrade410to420.java
@@ -17,6 +17,9 @@
 
 package com.cloud.upgrade.dao;
 
+import com.cloud.utils.exception.CloudRuntimeException;
+import com.cloud.utils.script.Script;
+
 import java.io.File;
 import java.sql.Connection;
 import java.sql.PreparedStatement;
@@ -26,9 +29,6 @@ import java.util.UUID;
 
 import org.apache.log4j.Logger;
 
-import com.cloud.utils.exception.CloudRuntimeException;
-import com.cloud.utils.script.Script;
-
 public class Upgrade410to420 implements DbUpgrade {
 	final static Logger s_logger = Logger.getLogger(Upgrade410to420.class);
 
@@ -61,7 +61,6 @@ public class Upgrade410to420 implements DbUpgrade {
 	public void performDataMigration(Connection conn) {
         upgradeVmwareLabels(conn);
         createPlaceHolderNics(conn);
-        updateRemoteAccessVpn(conn);
         PreparedStatement sql = null;
         try {
             sql = conn.prepareStatement("update vm_template set image_data_store_id = 1 where type = 'SYSTEM' or type = 'BUILTIN'");
@@ -160,7 +159,7 @@ public class Upgrade410to420 implements DbUpgrade {
             }
         }
     }
-    
+
     private void createPlaceHolderNics(Connection conn) {
         PreparedStatement pstmt = null;
         ResultSet rs = null;
@@ -181,44 +180,10 @@ public class Upgrade410to420 implements DbUpgrade {
                     pstmt.setLong(4, networkId);
                     pstmt.executeUpdate();
                     s_logger.debug("Created placeholder nic for the ipAddress " + ip);
-                
-            }
-        } catch (SQLException e) {
-            throw new CloudRuntimeException("Unable to create placeholder nics", e);
-        } finally {
-            try {
-                if (rs != null) {
-                    rs.close();
-                }
-                if (pstmt != null) {
-                    pstmt.close();
-                }
-            } catch (SQLException e) {
-            }
-        }
-    }
-    
-    
-    private void updateRemoteAccessVpn(Connection conn) {
-        PreparedStatement pstmt = null;
-        ResultSet rs = null;
 
-        try {
-            pstmt = conn.prepareStatement("SELECT vpn_server_addr_id FROM `cloud`.`remote_access_vpn`");
-            rs = pstmt.executeQuery();
-            long id=1;
-            while (rs.next()) {
-                    String uuid = UUID.randomUUID().toString();
-                    Long ipId = rs.getLong(1);
-                    pstmt = conn.prepareStatement("UPDATE `cloud`.`remote_access_vpn` set uuid=?, id=? where vpn_server_addr_id=?");
-                    pstmt.setString(1, uuid);
-                    pstmt.setLong(2, id);
-                    pstmt.setLong(3, ipId);
-                    pstmt.executeUpdate();
-                    id++;
             }
         } catch (SQLException e) {
-            throw new CloudRuntimeException("Unable to update id/uuid of remote_access_vpn table", e);
+            throw new CloudRuntimeException("Unable to create placeholder nics", e);
         } finally {
             try {
                 if (rs != null) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/70566dd3/server/src/com/cloud/vm/dao/NicDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/dao/NicDao.java b/server/src/com/cloud/vm/dao/NicDao.java
index eb38a8d..67b9d12 100644
--- a/server/src/com/cloud/vm/dao/NicDao.java
+++ b/server/src/com/cloud/vm/dao/NicDao.java
@@ -62,7 +62,7 @@ public interface NicDao extends GenericDao<NicVO, Long> {
     List<NicVO> listByVmIdAndNicId(Long vmId, Long nicId);
 
     NicVO findByIp4AddressAndVmId(String ip4Address, long instance);
-    
+
     List<NicVO> listPlaceholderNicsByNetworkId(long networkId);
-    
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/70566dd3/server/test/com/cloud/network/MockNetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/network/MockNetworkModelImpl.java b/server/test/com/cloud/network/MockNetworkModelImpl.java
index c578965..b926519 100644
--- a/server/test/com/cloud/network/MockNetworkModelImpl.java
+++ b/server/test/com/cloud/network/MockNetworkModelImpl.java
@@ -844,10 +844,4 @@ public class MockNetworkModelImpl extends ManagerBase implements NetworkModel {
         // TODO Auto-generated method stub
         return null;
     }
-
-    @Override
-    public boolean isProviderEnabledInZone(long zoneId, String provider) {
-        // TODO Auto-generated method stub
-        return false;
-    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/70566dd3/server/test/com/cloud/vpc/MockNetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockNetworkModelImpl.java b/server/test/com/cloud/vpc/MockNetworkModelImpl.java
index e1534cb..b05e8ea 100644
--- a/server/test/com/cloud/vpc/MockNetworkModelImpl.java
+++ b/server/test/com/cloud/vpc/MockNetworkModelImpl.java
@@ -857,10 +857,4 @@ public class MockNetworkModelImpl extends ManagerBase implements NetworkModel {
         return null;
     }
 
-    @Override
-    public boolean isProviderEnabledInZone(long zoneId, String provider) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
 }


[35/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
marvin-refactor: split base into multiple modules

Each entity goes into its own module
Append ASF license header to the entity

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


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

Branch: refs/heads/marvin_refactor
Commit: de442dfb5edc1eca3fd7c93c3903368dcd0dae3f
Parents: dd5572a
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Sat Jan 26 19:13:50 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:19:15 2013 +0530

----------------------------------------------------------------------

----------------------------------------------------------------------



[36/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
removing unused commented dependencies

removing the spring related dependencies that were commented out.

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


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

Branch: refs/heads/marvin_refactor
Commit: 0eb8077dec037816608f01ea3e0bee2d69c02e53
Parents: 45af2ef
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Sun Mar 10 11:38:48 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:19:15 2013 +0530

----------------------------------------------------------------------
 pom.xml |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0eb8077d/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9e9db69..ed24988 100644
--- a/pom.xml
+++ b/pom.xml
@@ -170,7 +170,6 @@
     <module>services</module>
     <module>test</module>
     <module>client</module>
-    <module>setup</module>
   </modules>
 
   <dependencyManagement>
@@ -189,12 +188,12 @@
       <artifactId>junit</artifactId>
       <version>${cs.junit.version}</version>
       <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>spring-core</artifactId>
-      <version>${org.springframework.version}</version>
-    </dependency>
+	</dependency>
+	<dependency>
+	  <groupId>org.springframework</groupId>
+	  <artifactId>spring-core</artifactId>
+	  <version>${org.springframework.version}</version>
+	</dependency>
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-context</artifactId>
@@ -217,6 +216,12 @@
       <version>${org.springframework.version}</version>
       <scope>test</scope>
     </dependency>
+	<dependency>
+	  <groupId>org.springframework</groupId>
+	  <artifactId>spring-test</artifactId>
+	  <version>${org.springframework.version}</version>
+	  <scope>test</scope>
+	</dependency>
     <dependency>
       <groupId>org.aspectj</groupId>
       <artifactId>aspectjrt</artifactId>


[10/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
CLOUDSTACK-1729: a partical resolution for user authenticators to unblock developers who are currently working on and relying on the fix


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

Branch: refs/heads/marvin_refactor
Commit: 37e9c91d87896185b774ad51a5b201ad5e0bf214
Parents: 7d4fd16
Author: Kelven Yang <ke...@gmail.com>
Authored: Tue Mar 19 15:47:08 2013 -0700
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:01:40 2013 +0530

----------------------------------------------------------------------
 client/tomcatconf/componentContext.xml.in          |   20 +++++++++++++-
 .../src/com/cloud/server/ManagementServerImpl.java |    8 ++++++
 server/src/com/cloud/user/AccountManagerImpl.java  |   20 +++-----------
 3 files changed, 31 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/37e9c91d/client/tomcatconf/componentContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/componentContext.xml.in b/client/tomcatconf/componentContext.xml.in
index 9b819c3..dad5d4d 100644
--- a/client/tomcatconf/componentContext.xml.in
+++ b/client/tomcatconf/componentContext.xml.in
@@ -36,9 +36,25 @@
   -->
   <bean id="databaseUpgradeChecker" class="com.cloud.upgrade.DatabaseUpgradeChecker" />
   <bean id="encryptionSecretKeyChecker" class="com.cloud.utils.crypt.EncryptionSecretKeyChecker" />
-  
-  <bean id="managementServerImpl" class ="com.cloud.server.ManagementServerImpl" />
   <bean id="configurationServerImpl" class="com.cloud.server.ConfigurationServerImpl" />
+
+  <bean id="managementServerImpl" class ="com.cloud.server.ManagementServerImpl" >
+    <property name="UserAuthenticators">
+        <list>
+            <ref bean="MD5UserAuthenticator"/>
+            <ref bean="LDAPUserAuthenticator"/>
+        </list>
+    </property>
+  </bean>
+
+  <bean id ="AccountManagerImpl" class="com.cloud.user.AccountManagerImpl">
+    <property name="UserAuthenticators">
+        <list>
+            <ref bean="MD5UserAuthenticator"/>
+            <ref bean="LDAPUserAuthenticator"/>
+        </list>
+    </property>
+  </bean>
    
   <bean id="clusterManagerImpl" class="com.cloud.cluster.ClusterManagerImpl" />
   <bean id="clusteredAgentManagerImpl" class="com.cloud.agent.manager.ClusteredAgentManagerImpl" />

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/37e9c91d/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index d0904e1..baa09bc 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -482,6 +482,14 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
 		this._hostAllocators = _hostAllocators;
 	}
 
+    public List<UserAuthenticator> getUserAuthenticators() {
+	return _userAuthenticators;
+    }
+
+    public void setUserAuthenticators(List<UserAuthenticator> authenticators) {
+	_userAuthenticators = authenticators;
+    }
+
 	@Override
 	public boolean configure(String name, Map<String, Object> params)
 			throws ConfigurationException {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/37e9c91d/server/src/com/cloud/user/AccountManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java
index 40db4ed..93bb725 100755
--- a/server/src/com/cloud/user/AccountManagerImpl.java
+++ b/server/src/com/cloud/user/AccountManagerImpl.java
@@ -230,26 +230,18 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
     UserVO _systemUser;
     AccountVO _systemAccount;
 
+    @Inject
     List<SecurityChecker> _securityCheckers;
-    
-	int _cleanupInterval;
+    int _cleanupInterval;
 
     public List<UserAuthenticator> getUserAuthenticators() {
-    	return _userAuthenticators;
+	return _userAuthenticators;
     }
-    
+
     public void setUserAuthenticators(List<UserAuthenticator> authenticators) {
-    	_userAuthenticators = authenticators;
+	_userAuthenticators = authenticators;
     }
-    
-    public List<SecurityChecker> getSecurityCheckers() {
-		return _securityCheckers;
-	}
 
-	public void setSecurityCheckers(List<SecurityChecker> securityCheckers) {
-		this._securityCheckers = securityCheckers;
-	}
-    
     @Override
     public boolean configure(final String name, final Map<String, Object> params) throws ConfigurationException {
         _systemAccount = _accountDao.findById(AccountVO.ACCOUNT_ID_SYSTEM);
@@ -1180,7 +1172,6 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
     }
 
     @Override
-    @ActionEvent(eventType = EventTypes.EVENT_ACCOUNT_ENABLE, eventDescription = "enabling account", async = true)
     public AccountVO enableAccount(String accountName, Long domainId, Long accountId) {
 
         // Check if account exists
@@ -1271,7 +1262,6 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
 
     @Override
     @DB
-    @ActionEvent(eventType = EventTypes.EVENT_ACCOUNT_UPDATE, eventDescription = "updating account", async = true)
     public AccountVO updateAccount(UpdateAccountCmd cmd) {
         Long accountId = cmd.getId();
         Long domainId = cmd.getDomainId();


[11/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
CLOUDSTACK-1065: cloudstack UI - AWS Style Regions - set current region (whose end point matches current URL) to region button and region dropdown on top menu.


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

Branch: refs/heads/marvin_refactor
Commit: 4d3a9995fef40604aca0a50adebf83ddd01163bb
Parents: 7c5f5c3
Author: Jessica Wang <je...@citrix.com>
Authored: Wed Mar 20 14:34:37 2013 -0700
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:02:00 2013 +0530

----------------------------------------------------------------------
 ui/scripts/regions.js           |    3 +--
 ui/scripts/ui-custom/regions.js |   15 ++++++++++-----
 2 files changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4d3a9995/ui/scripts/regions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/regions.js b/ui/scripts/regions.js
index 917b761..6e87c7f 100644
--- a/ui/scripts/regions.js
+++ b/ui/scripts/regions.js
@@ -29,8 +29,7 @@
               data: regions ? regions : [
                 { id: -1, name: '(Default)' }
               ],
-              activeRegionID: cloudStack.context.users.regionid ?
-                cloudStack.context.users.regionid : 1
+              activeRegionID: cloudStack.context.users[0].regionid
             });
           }
         }); 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4d3a9995/ui/scripts/ui-custom/regions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/regions.js b/ui/scripts/ui-custom/regions.js
index b29d914..611edda 100644
--- a/ui/scripts/ui-custom/regions.js
+++ b/ui/scripts/ui-custom/regions.js
@@ -29,6 +29,7 @@
             var data = args.data;
             var activeRegionID = args.activeRegionID;
 
+						var currentRegion;
             $(data).each(function() {
               var region = this;
               var regionName = region.name;
@@ -36,16 +37,20 @@
 
               $li.data('region-data', region);
 
+							if(document.location.href == region.endpoint) {
+                currentRegion = region;
+								$li.addClass('active');
+							}
+							/*
               if (region.id == activeRegionID) {
                 $li.addClass('active');
               }
-              
-              $regionSwitcherButton.find('.title')
-                .html(regionName)
-                .attr('title', regionName);
-              
+              */
+
               $regionList.append($li);
             });
+
+						$regionSwitcherButton.find('.title').html(_s(currentRegion.name)).attr('title', _s(currentRegion.name));
           }
         }
       });


[48/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
removing redundant entities

Some entities do not conform to the CRUD format and define extra verbs -
eg: markDefaultNicForVirtualMachine, ldapConfig, ldapRemove etc.

These are refactored and combined into their respective entities.

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


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

Branch: refs/heads/marvin_refactor
Commit: cbc5ffa1042e959d959834fffdb8e378b867df12
Parents: c7c15cf
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Tue Apr 9 17:57:33 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Tue Apr 9 17:57:33 2013 +0530

----------------------------------------------------------------------
 .../marvin/marvin/integration/lib/base/Account.py  |   10 ++
 .../integration/lib/base/AccountFromProject.py     |   35 --------
 .../integration/lib/base/AccountToProject.py       |   34 --------
 .../integration/lib/base/AutoScalePolicies.py      |   33 -------
 .../marvin/integration/lib/base/AutoScalePolicy.py |    8 ++
 tools/marvin/marvin/integration/lib/base/Config.py |   33 -------
 .../lib/base/DefaultNicForVirtualMachine.py        |   35 --------
 .../integration/lib/base/DefaultZoneForAccount.py  |   36 --------
 .../lib/base/FromGlobalLoadBalancerRule.py         |   34 --------
 .../integration/lib/base/FromLoadBalancerRule.py   |   35 --------
 .../integration/lib/base/GlobalLoadBalancerRule.py |   26 +++++-
 tools/marvin/marvin/integration/lib/base/Host.py   |   29 +++++++
 .../integration/lib/base/HostForMaintenance.py     |   34 --------
 .../marvin/integration/lib/base/HostMaintenance.py |   34 --------
 .../marvin/integration/lib/base/HostPassword.py    |   35 --------
 .../marvin/integration/lib/base/IpFromNic.py       |   34 --------
 .../marvin/marvin/integration/lib/base/IpToNic.py  |   34 --------
 .../integration/lib/base/LBHealthCheckPolicies.py  |   33 -------
 .../integration/lib/base/LBHealthCheckPolicy.py    |   10 ++
 .../integration/lib/base/LBStickinessPolicies.py   |   34 --------
 .../integration/lib/base/LBStickinessPolicy.py     |   11 +++
 tools/marvin/marvin/integration/lib/base/Ldap.py   |   42 +++++++++
 .../integration/lib/base/LoadBalancerRule.py       |   38 ++++++++-
 .../lib/base/LoadBalancerRuleInstances.py          |   34 --------
 tools/marvin/marvin/integration/lib/base/Nic.py    |   56 ++++++++++++
 .../integration/lib/base/NicFromVirtualMachine.py  |   35 --------
 .../integration/lib/base/NicToVirtualMachine.py    |   35 --------
 .../marvin/integration/lib/base/NiciraNvpDevice.py |    9 ++
 .../lib/base/NiciraNvpDeviceNetworks.py            |   34 --------
 tools/marvin/marvin/integration/lib/base/Nics.py   |   34 --------
 .../lib/base/PasswordForVirtualMachine.py          |   34 --------
 .../marvin/integration/lib/base/PhysicalNetwork.py |    6 +-
 tools/marvin/marvin/integration/lib/base/Pod.py    |    6 +-
 .../integration/lib/base/PortForwardingRule.py     |    3 +-
 .../marvin/integration/lib/base/PrivateGateway.py  |    3 +-
 .../marvin/marvin/integration/lib/base/Project.py  |   40 +++++++--
 .../marvin/integration/lib/base/ProjectAccounts.py |   34 --------
 tools/marvin/marvin/integration/lib/base/Remove.py |   33 -------
 .../lib/base/SSHKeyForVirtualMachine.py            |   35 --------
 .../marvin/integration/lib/base/SecurityGroup.py   |   30 +++++++
 .../integration/lib/base/SecurityGroupEgress.py    |   43 ----------
 .../integration/lib/base/SecurityGroupIngress.py   |   43 ----------
 .../marvin/marvin/integration/lib/base/Snapshot.py |    3 +-
 .../integration/lib/base/SnapshotPolicies.py       |   43 ----------
 .../marvin/integration/lib/base/SnapshotPolicy.py  |   18 ++++
 .../integration/lib/base/StorageMaintenance.py     |   44 ----------
 .../marvin/integration/lib/base/StoragePool.py     |   18 ++++
 .../lib/base/ToGlobalLoadBalancerRule.py           |   34 --------
 .../integration/lib/base/ToLoadBalancerRule.py     |   35 --------
 tools/marvin/marvin/integration/lib/base/User.py   |    9 ++
 .../marvin/marvin/integration/lib/base/UserKeys.py |   34 --------
 .../marvin/integration/lib/base/VirtualMachine.py  |   66 ++++++++++++---
 52 files changed, 399 insertions(+), 1139 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/Account.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Account.py b/tools/marvin/marvin/integration/lib/base/Account.py
index 7da8f9d..b0aebbf 100644
--- a/tools/marvin/marvin/integration/lib/base/Account.py
+++ b/tools/marvin/marvin/integration/lib/base/Account.py
@@ -22,6 +22,7 @@ from marvin.cloudstackAPI import listAccounts
 from marvin.cloudstackAPI import updateAccount
 from marvin.cloudstackAPI import disableAccount
 from marvin.cloudstackAPI import deleteAccount
+from marvin.cloudstackAPI import markDefaultZoneForAccount
 
 class Account(CloudStackEntity.CloudStackEntity):
 
@@ -91,3 +92,12 @@ class Account(CloudStackEntity.CloudStackEntity):
         account = apiclient.deleteAccount(cmd)
         return account
 
+    def mark(self, apiclient, zoneid, **kwargs):
+        cmd = markDefaultZoneForAccount.markDefaultZoneForAccountCmd()
+        cmd.id = self.id
+        cmd.account = self.account
+        cmd.domainid = self.domainid
+        cmd.zoneid = zoneid
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        defaultzoneforaccount = apiclient.markDefaultZoneForAccount(cmd)
+        return defaultzoneforaccount

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/AccountFromProject.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AccountFromProject.py b/tools/marvin/marvin/integration/lib/base/AccountFromProject.py
deleted file mode 100644
index de86c95..0000000
--- a/tools/marvin/marvin/integration/lib/base/AccountFromProject.py
+++ /dev/null
@@ -1,35 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import deleteAccountFromProject
-
-class AccountFromProject(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def delete(self, apiclient, projectid, account, **kwargs):
-        cmd = deleteAccountFromProject.deleteAccountFromProjectCmd()
-        cmd.id = self.id
-        cmd.account = account
-        cmd.projectid = projectid
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        accountfromproject = apiclient.deleteAccountFromProject(cmd)
-        return accountfromproject
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/AccountToProject.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AccountToProject.py b/tools/marvin/marvin/integration/lib/base/AccountToProject.py
deleted file mode 100644
index 568464a..0000000
--- a/tools/marvin/marvin/integration/lib/base/AccountToProject.py
+++ /dev/null
@@ -1,34 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import addAccountToProject
-
-class AccountToProject(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def add(self, apiclient, projectid, **kwargs):
-        cmd = addAccountToProject.addAccountToProjectCmd()
-        cmd.id = self.id
-        cmd.projectid = projectid
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        accounttoproject = apiclient.addAccountToProject(cmd)
-        return accounttoproject
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/AutoScalePolicies.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AutoScalePolicies.py b/tools/marvin/marvin/integration/lib/base/AutoScalePolicies.py
deleted file mode 100644
index 2866887..0000000
--- a/tools/marvin/marvin/integration/lib/base/AutoScalePolicies.py
+++ /dev/null
@@ -1,33 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import listAutoScalePolicies
-
-class AutoScalePolicies(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    @classmethod
-    def list(self, apiclient, **kwargs):
-        cmd = listAutoScalePolicies.listAutoScalePoliciesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        autoscalepolicies = apiclient.listAutoScalePolicies(cmd)
-        return map(lambda e: AutoScalePolicies(e.__dict__), autoscalepolicies)
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/AutoScalePolicy.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AutoScalePolicy.py b/tools/marvin/marvin/integration/lib/base/AutoScalePolicy.py
index 04411ad..fb20271 100644
--- a/tools/marvin/marvin/integration/lib/base/AutoScalePolicy.py
+++ b/tools/marvin/marvin/integration/lib/base/AutoScalePolicy.py
@@ -18,6 +18,7 @@ from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import createAutoScalePolicy
 from marvin.cloudstackAPI import updateAutoScalePolicy
 from marvin.cloudstackAPI import deleteAutoScalePolicy
+from marvin.cloudstackAPI import listAutoScalePolicies
 
 class AutoScalePolicy(CloudStackEntity.CloudStackEntity):
 
@@ -52,3 +53,10 @@ class AutoScalePolicy(CloudStackEntity.CloudStackEntity):
         autoscalepolicy = apiclient.deleteAutoScalePolicy(cmd)
         return autoscalepolicy
 
+    @classmethod
+    def list(self, apiclient, **kwargs):
+        cmd = listAutoScalePolicies.listAutoScalePoliciesCmd()
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        autoscalepolicies = apiclient.listAutoScalePolicies(cmd)
+        return map(lambda e: AutoScalePolicy(e.__dict__), autoscalepolicies)
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/Config.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Config.py b/tools/marvin/marvin/integration/lib/base/Config.py
deleted file mode 100644
index 11d3a7b..0000000
--- a/tools/marvin/marvin/integration/lib/base/Config.py
+++ /dev/null
@@ -1,33 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import ldapConfig
-
-class Config(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def ldap(self, apiclient, **kwargs):
-        cmd = ldapConfig.ldapConfigCmd()
-        cmd.id = self.id
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        config = apiclient.ldapConfig(cmd)
-        return config
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/DefaultNicForVirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/DefaultNicForVirtualMachine.py b/tools/marvin/marvin/integration/lib/base/DefaultNicForVirtualMachine.py
deleted file mode 100644
index 0d227c1..0000000
--- a/tools/marvin/marvin/integration/lib/base/DefaultNicForVirtualMachine.py
+++ /dev/null
@@ -1,35 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import updateDefaultNicForVirtualMachine
-
-class DefaultNicForVirtualMachine(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def update(self, apiclient, nicid, virtualmachineid, **kwargs):
-        cmd = updateDefaultNicForVirtualMachine.updateDefaultNicForVirtualMachineCmd()
-        cmd.id = self.id
-        cmd.nicid = nicid
-        cmd.virtualmachineid = virtualmachineid
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        defaultnicforvirtualmachine = apiclient.updateDefaultNicForVirtualMachine(cmd)
-        return defaultnicforvirtualmachine
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/DefaultZoneForAccount.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/DefaultZoneForAccount.py b/tools/marvin/marvin/integration/lib/base/DefaultZoneForAccount.py
deleted file mode 100644
index f9f11ea..0000000
--- a/tools/marvin/marvin/integration/lib/base/DefaultZoneForAccount.py
+++ /dev/null
@@ -1,36 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import markDefaultZoneForAccount
-
-class DefaultZoneForAccount(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def mark(self, apiclient, account, domainid, zoneid, **kwargs):
-        cmd = markDefaultZoneForAccount.markDefaultZoneForAccountCmd()
-        cmd.id = self.id
-        cmd.account = account
-        cmd.domainid = domainid
-        cmd.zoneid = zoneid
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        defaultzoneforaccount = apiclient.markDefaultZoneForAccount(cmd)
-        return defaultzoneforaccount
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/FromGlobalLoadBalancerRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/FromGlobalLoadBalancerRule.py b/tools/marvin/marvin/integration/lib/base/FromGlobalLoadBalancerRule.py
deleted file mode 100644
index 73c7123..0000000
--- a/tools/marvin/marvin/integration/lib/base/FromGlobalLoadBalancerRule.py
+++ /dev/null
@@ -1,34 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import removeFromGlobalLoadBalancerRule
-
-class FromGlobalLoadBalancerRule(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def remove(self, apiclient, loadbalancerrulelist, id, **kwargs):
-        cmd = removeFromGlobalLoadBalancerRule.removeFromGlobalLoadBalancerRuleCmd()
-        cmd.id = self.id
-        cmd.id = id
-        cmd.loadbalancerrulelist = loadbalancerrulelist
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        fromgloballoadbalancerrule = apiclient.removeFromGlobalLoadBalancerRule(cmd)
-        return fromgloballoadbalancerrule

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/FromLoadBalancerRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/FromLoadBalancerRule.py b/tools/marvin/marvin/integration/lib/base/FromLoadBalancerRule.py
deleted file mode 100644
index 352e94a..0000000
--- a/tools/marvin/marvin/integration/lib/base/FromLoadBalancerRule.py
+++ /dev/null
@@ -1,35 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import removeFromLoadBalancerRule
-
-class FromLoadBalancerRule(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def remove(self, apiclient, id, virtualmachineids, **kwargs):
-        cmd = removeFromLoadBalancerRule.removeFromLoadBalancerRuleCmd()
-        cmd.id = self.id
-        cmd.id = id
-        cmd.virtualmachineids = virtualmachineids
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        fromloadbalancerrule = apiclient.removeFromLoadBalancerRule(cmd)
-        return fromloadbalancerrule
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/GlobalLoadBalancerRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/GlobalLoadBalancerRule.py b/tools/marvin/marvin/integration/lib/base/GlobalLoadBalancerRule.py
index 320d144..dbb821e 100644
--- a/tools/marvin/marvin/integration/lib/base/GlobalLoadBalancerRule.py
+++ b/tools/marvin/marvin/integration/lib/base/GlobalLoadBalancerRule.py
@@ -19,6 +19,8 @@ from marvin.cloudstackAPI import createGlobalLoadBalancerRule
 from marvin.cloudstackAPI import listGlobalLoadBalancerRules
 from marvin.cloudstackAPI import updateGlobalLoadBalancerRule
 from marvin.cloudstackAPI import deleteGlobalLoadBalancerRule
+from marvin.cloudstackAPI import removeFromGlobalLoadBalancerRule
+from marvin.cloudstackAPI import assignToGlobalLoadBalancerRule
 
 class GlobalLoadBalancerRule(CloudStackEntity.CloudStackEntity):
 
@@ -44,19 +46,35 @@ class GlobalLoadBalancerRule(CloudStackEntity.CloudStackEntity):
         return map(lambda e: GlobalLoadBalancerRule(e.__dict__), globalloadbalancerrule)
 
 
-    def update(self, apiclient, id, **kwargs):
+    def update(self, apiclient, **kwargs):
         cmd = updateGlobalLoadBalancerRule.updateGlobalLoadBalancerRuleCmd()
         cmd.id = self.id
-        cmd.id = id
         [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         globalloadbalancerrule = apiclient.updateGlobalLoadBalancerRule(cmd)
         return globalloadbalancerrule
 
 
-    def delete(self, apiclient, id, **kwargs):
+    def delete(self, apiclient, **kwargs):
         cmd = deleteGlobalLoadBalancerRule.deleteGlobalLoadBalancerRuleCmd()
         cmd.id = self.id
-        cmd.id = id
         [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         globalloadbalancerrule = apiclient.deleteGlobalLoadBalancerRule(cmd)
         return globalloadbalancerrule
+
+
+    def remove(self, apiclient, loadbalancerrulelist, **kwargs):
+        cmd = removeFromGlobalLoadBalancerRule.removeFromGlobalLoadBalancerRuleCmd()
+        cmd.id = self.id
+        cmd.loadbalancerrulelist = loadbalancerrulelist
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        fromgloballoadbalancerrule = apiclient.removeFromGlobalLoadBalancerRule(cmd)
+        return fromgloballoadbalancerrule
+
+
+    def assign(self, apiclient, loadbalancerrulelist, **kwargs):
+        cmd = assignToGlobalLoadBalancerRule.assignToGlobalLoadBalancerRuleCmd()
+        cmd.id = self.id
+        cmd.loadbalancerrulelist = loadbalancerrulelist
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        togloballoadbalancerrule = apiclient.assignToGlobalLoadBalancerRule(cmd)
+        return togloballoadbalancerrule
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/Host.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Host.py b/tools/marvin/marvin/integration/lib/base/Host.py
index 66d77eb..d8c7953 100644
--- a/tools/marvin/marvin/integration/lib/base/Host.py
+++ b/tools/marvin/marvin/integration/lib/base/Host.py
@@ -20,6 +20,9 @@ from marvin.cloudstackAPI import listHosts
 from marvin.cloudstackAPI import updateHost
 from marvin.cloudstackAPI import reconnectHost
 from marvin.cloudstackAPI import deleteHost
+from marvin.cloudstackAPI import prepareHostForMaintenance
+from marvin.cloudstackAPI import cancelHostMaintenance
+from marvin.cloudstackAPI import updateHostPassword
 
 class Host(CloudStackEntity.CloudStackEntity):
 
@@ -76,3 +79,29 @@ class Host(CloudStackEntity.CloudStackEntity):
         host = apiclient.deleteHost(cmd)
         return host
 
+
+    def prepareMaintenance(self, apiclient, **kwargs):
+        cmd = prepareHostForMaintenance.prepareHostForMaintenanceCmd()
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        hostformaintenance = apiclient.prepareHostForMaintenance(cmd)
+        return hostformaintenance
+
+
+    def cancelMaintenance(self, apiclient, **kwargs):
+        cmd = cancelHostMaintenance.cancelHostMaintenanceCmd()
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        hostmaintenance = apiclient.cancelHostMaintenance(cmd)
+        return hostmaintenance
+
+
+    def updatePassword(self, apiclient, username, password, **kwargs):
+        cmd = updateHostPassword.updateHostPasswordCmd()
+        cmd.id = self.id
+        cmd.password = password
+        cmd.username = username
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        hostpassword = apiclient.updateHostPassword(cmd)
+        return hostpassword
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/HostForMaintenance.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/HostForMaintenance.py b/tools/marvin/marvin/integration/lib/base/HostForMaintenance.py
deleted file mode 100644
index 05861a0..0000000
--- a/tools/marvin/marvin/integration/lib/base/HostForMaintenance.py
+++ /dev/null
@@ -1,34 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import prepareHostForMaintenance
-
-class HostForMaintenance(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def prepare(self, apiclient, id, **kwargs):
-        cmd = prepareHostForMaintenance.prepareHostForMaintenanceCmd()
-        cmd.id = self.id
-        cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        hostformaintenance = apiclient.prepareHostForMaintenance(cmd)
-        return hostformaintenance
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/HostMaintenance.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/HostMaintenance.py b/tools/marvin/marvin/integration/lib/base/HostMaintenance.py
deleted file mode 100644
index 0ea8689..0000000
--- a/tools/marvin/marvin/integration/lib/base/HostMaintenance.py
+++ /dev/null
@@ -1,34 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import cancelHostMaintenance
-
-class HostMaintenance(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def cancel(self, apiclient, id, **kwargs):
-        cmd = cancelHostMaintenance.cancelHostMaintenanceCmd()
-        cmd.id = self.id
-        cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        hostmaintenance = apiclient.cancelHostMaintenance(cmd)
-        return hostmaintenance
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/HostPassword.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/HostPassword.py b/tools/marvin/marvin/integration/lib/base/HostPassword.py
deleted file mode 100644
index 93d9636..0000000
--- a/tools/marvin/marvin/integration/lib/base/HostPassword.py
+++ /dev/null
@@ -1,35 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import updateHostPassword
-
-class HostPassword(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def update(self, apiclient, username, password, **kwargs):
-        cmd = updateHostPassword.updateHostPasswordCmd()
-        cmd.id = self.id
-        cmd.password = password
-        cmd.username = username
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        hostpassword = apiclient.updateHostPassword(cmd)
-        return hostpassword
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/IpFromNic.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/IpFromNic.py b/tools/marvin/marvin/integration/lib/base/IpFromNic.py
deleted file mode 100644
index b07acea..0000000
--- a/tools/marvin/marvin/integration/lib/base/IpFromNic.py
+++ /dev/null
@@ -1,34 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import removeIpFromNic
-
-class IpFromNic(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def remove(self, apiclient, id, **kwargs):
-        cmd = removeIpFromNic.removeIpFromNicCmd()
-        cmd.id = self.id
-        cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        ipfromnic = apiclient.removeIpFromNic(cmd)
-        return ipfromnic
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/IpToNic.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/IpToNic.py b/tools/marvin/marvin/integration/lib/base/IpToNic.py
deleted file mode 100644
index 74d434d..0000000
--- a/tools/marvin/marvin/integration/lib/base/IpToNic.py
+++ /dev/null
@@ -1,34 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import addIpToNic
-
-class IpToNic(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def add(self, apiclient, nicid, **kwargs):
-        cmd = addIpToNic.addIpToNicCmd()
-        cmd.id = self.id
-        cmd.nicid = nicid
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        iptonic = apiclient.addIpToNic(cmd)
-        return iptonic
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/LBHealthCheckPolicies.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/LBHealthCheckPolicies.py b/tools/marvin/marvin/integration/lib/base/LBHealthCheckPolicies.py
deleted file mode 100644
index a2a79e1..0000000
--- a/tools/marvin/marvin/integration/lib/base/LBHealthCheckPolicies.py
+++ /dev/null
@@ -1,33 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import listLBHealthCheckPolicies
-
-class LBHealthCheckPolicies(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    @classmethod
-    def list(self, apiclient, lbruleid, **kwargs):
-        cmd = listLBHealthCheckPolicies.listLBHealthCheckPoliciesCmd()
-        cmd.lbruleid = lbruleid
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        lbhealthcheckpolicies = apiclient.listLBHealthCheckPolicies(cmd)
-        return map(lambda e: LBHealthCheckPolicies(e.__dict__), lbhealthcheckpolicies)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/LBHealthCheckPolicy.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/LBHealthCheckPolicy.py b/tools/marvin/marvin/integration/lib/base/LBHealthCheckPolicy.py
index e6b10a3..1ecc03d 100644
--- a/tools/marvin/marvin/integration/lib/base/LBHealthCheckPolicy.py
+++ b/tools/marvin/marvin/integration/lib/base/LBHealthCheckPolicy.py
@@ -17,6 +17,7 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import createLBHealthCheckPolicy
 from marvin.cloudstackAPI import deleteLBHealthCheckPolicy
+from marvin.cloudstackAPI import listLBHealthCheckPolicies
 
 class LBHealthCheckPolicy(CloudStackEntity.CloudStackEntity):
 
@@ -41,3 +42,12 @@ class LBHealthCheckPolicy(CloudStackEntity.CloudStackEntity):
         [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         lbhealthcheckpolicy = apiclient.deleteLBHealthCheckPolicy(cmd)
         return lbhealthcheckpolicy
+
+
+    @classmethod
+    def list(self, apiclient, lbruleid, **kwargs):
+        cmd = listLBHealthCheckPolicies.listLBHealthCheckPoliciesCmd()
+        cmd.lbruleid = lbruleid
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        lbhealthcheckpolicies = apiclient.listLBHealthCheckPolicies(cmd)
+        return map(lambda e: LBHealthCheckPolicy(e.__dict__), lbhealthcheckpolicies)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/LBStickinessPolicies.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/LBStickinessPolicies.py b/tools/marvin/marvin/integration/lib/base/LBStickinessPolicies.py
deleted file mode 100644
index dc9b520..0000000
--- a/tools/marvin/marvin/integration/lib/base/LBStickinessPolicies.py
+++ /dev/null
@@ -1,34 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import listLBStickinessPolicies
-
-class LBStickinessPolicies(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    @classmethod
-    def list(self, apiclient, lbruleid, **kwargs):
-        cmd = listLBStickinessPolicies.listLBStickinessPoliciesCmd()
-        cmd.lbruleid = lbruleid
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        lbstickinesspolicies = apiclient.listLBStickinessPolicies(cmd)
-        return map(lambda e: LBStickinessPolicies(e.__dict__), lbstickinesspolicies)
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/LBStickinessPolicy.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/LBStickinessPolicy.py b/tools/marvin/marvin/integration/lib/base/LBStickinessPolicy.py
index 3d88f05..11c87f5 100644
--- a/tools/marvin/marvin/integration/lib/base/LBStickinessPolicy.py
+++ b/tools/marvin/marvin/integration/lib/base/LBStickinessPolicy.py
@@ -17,6 +17,7 @@
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import createLBStickinessPolicy
 from marvin.cloudstackAPI import deleteLBStickinessPolicy
+from marvin.cloudstackAPI import listLBStickinessPolicies
 
 class LBStickinessPolicy(CloudStackEntity.CloudStackEntity):
 
@@ -42,3 +43,13 @@ class LBStickinessPolicy(CloudStackEntity.CloudStackEntity):
         lbstickinesspolicy = apiclient.deleteLBStickinessPolicy(cmd)
         return lbstickinesspolicy
 
+
+    @classmethod
+    def list(self, apiclient, lbruleid, **kwargs):
+        cmd = listLBStickinessPolicies.listLBStickinessPoliciesCmd()
+        cmd.lbruleid = lbruleid
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        lbstickinesspolicies = apiclient.listLBStickinessPolicies(cmd)
+        return map(lambda e: LBStickinessPolicy(e.__dict__), lbstickinesspolicies)
+
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/Ldap.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Ldap.py b/tools/marvin/marvin/integration/lib/base/Ldap.py
new file mode 100644
index 0000000..795c573
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/base/Ldap.py
@@ -0,0 +1,42 @@
+# 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.
+from marvin.integration.lib.base import CloudStackEntity
+from marvin.cloudstackAPI import ldapRemove
+from marvin.cloudstackAPI import ldapConfig
+
+class Ldap(CloudStackEntity.CloudStackEntity):
+
+
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
+    def config(self, apiclient, **kwargs):
+        cmd = ldapConfig.ldapConfigCmd()
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        config = apiclient.ldapConfig(cmd)
+        return config
+
+
+    def remove(self, apiclient, **kwargs):
+        cmd = ldapRemove.ldapRemoveCmd()
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        remove = apiclient.ldapRemove(cmd)
+        return remove
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/LoadBalancerRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/LoadBalancerRule.py b/tools/marvin/marvin/integration/lib/base/LoadBalancerRule.py
index b386ae1..1b5f1e3 100644
--- a/tools/marvin/marvin/integration/lib/base/LoadBalancerRule.py
+++ b/tools/marvin/marvin/integration/lib/base/LoadBalancerRule.py
@@ -19,6 +19,9 @@ from marvin.cloudstackAPI import createLoadBalancerRule
 from marvin.cloudstackAPI import listLoadBalancerRules
 from marvin.cloudstackAPI import updateLoadBalancerRule
 from marvin.cloudstackAPI import deleteLoadBalancerRule
+from marvin.cloudstackAPI import removeFromLoadBalancerRule
+from marvin.cloudstackAPI import listLoadBalancerRuleInstances
+from marvin.cloudstackAPI import assignToLoadBalancerRule
 
 class LoadBalancerRule(CloudStackEntity.CloudStackEntity):
 
@@ -44,20 +47,47 @@ class LoadBalancerRule(CloudStackEntity.CloudStackEntity):
         return map(lambda e: LoadBalancerRule(e.__dict__), loadbalancerrule)
 
 
-    def update(self, apiclient, id, **kwargs):
+    def update(self, apiclient, **kwargs):
         cmd = updateLoadBalancerRule.updateLoadBalancerRuleCmd()
         cmd.id = self.id
-        cmd.id = id
         [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         loadbalancerrule = apiclient.updateLoadBalancerRule(cmd)
         return loadbalancerrule
 
 
-    def delete(self, apiclient, id, **kwargs):
+    def delete(self, apiclient, **kwargs):
         cmd = deleteLoadBalancerRule.deleteLoadBalancerRuleCmd()
         cmd.id = self.id
-        cmd.id = id
         [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         loadbalancerrule = apiclient.deleteLoadBalancerRule(cmd)
         return loadbalancerrule
 
+
+    def remove(self, apiclient, virtualmachineids, **kwargs):
+        cmd = removeFromLoadBalancerRule.removeFromLoadBalancerRuleCmd()
+        cmd.id = self.id
+        cmd.virtualmachineids = virtualmachineids
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        fromloadbalancerrule = apiclient.removeFromLoadBalancerRule(cmd)
+        return fromloadbalancerrule
+
+
+    def assign(self, apiclient, virtualmachineids, **kwargs):
+        cmd = assignToLoadBalancerRule.assignToLoadBalancerRuleCmd()
+        cmd.id = self.id
+        cmd.virtualmachineids = virtualmachineids
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        toloadbalancerrule = apiclient.assignToLoadBalancerRule(cmd)
+        return toloadbalancerrule
+
+
+    @classmethod
+    def listInstances(self, apiclient, **kwargs):
+        cmd = listLoadBalancerRuleInstances.listLoadBalancerRuleInstancesCmd()
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        loadbalancerruleinstances = apiclient.listLoadBalancerRuleInstances(cmd)
+        return map(lambda e: LoadBalancerRule(e.__dict__), loadbalancerruleinstances)
+
+
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/LoadBalancerRuleInstances.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/LoadBalancerRuleInstances.py b/tools/marvin/marvin/integration/lib/base/LoadBalancerRuleInstances.py
deleted file mode 100644
index 07a2fe1..0000000
--- a/tools/marvin/marvin/integration/lib/base/LoadBalancerRuleInstances.py
+++ /dev/null
@@ -1,34 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import listLoadBalancerRuleInstances
-
-class LoadBalancerRuleInstances(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    @classmethod
-    def list(self, apiclient, id, **kwargs):
-        cmd = listLoadBalancerRuleInstances.listLoadBalancerRuleInstancesCmd()
-        cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        loadbalancerruleinstances = apiclient.listLoadBalancerRuleInstances(cmd)
-        return map(lambda e: LoadBalancerRuleInstances(e.__dict__), loadbalancerruleinstances)
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/Nic.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Nic.py b/tools/marvin/marvin/integration/lib/base/Nic.py
new file mode 100644
index 0000000..cfa3b6e
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/base/Nic.py
@@ -0,0 +1,56 @@
+# 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.
+from marvin.integration.lib.base import CloudStackEntity
+from marvin.cloudstackAPI import listNics
+from marvin.cloudstackAPI import addIpToNic
+from marvin.cloudstackAPI import removeIpFromNic
+
+class Nic(CloudStackEntity.CloudStackEntity):
+
+
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
+    @classmethod
+    def list(self, apiclient, virtualmachineid, **kwargs):
+        cmd = listNics.listNicsCmd()
+        cmd.virtualmachineid = virtualmachineid
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        nics = apiclient.listNics(cmd)
+        return map(lambda e: Nic(e.__dict__), nics)
+
+
+    def add_ip(self, apiclient, **kwargs):
+        cmd = addIpToNic.addIpToNicCmd()
+        cmd.nicid = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        iptonic = apiclient.addIpToNic(cmd)
+        return iptonic
+
+
+    def remove_ip(self, apiclient, **kwargs):
+        cmd = removeIpFromNic.removeIpFromNicCmd()
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        ipfromnic = apiclient.removeIpFromNic(cmd)
+        return ipfromnic
+
+
+
+
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/NicFromVirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/NicFromVirtualMachine.py b/tools/marvin/marvin/integration/lib/base/NicFromVirtualMachine.py
deleted file mode 100644
index 812dcc8..0000000
--- a/tools/marvin/marvin/integration/lib/base/NicFromVirtualMachine.py
+++ /dev/null
@@ -1,35 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import removeNicFromVirtualMachine
-
-class NicFromVirtualMachine(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def remove(self, apiclient, nicid, virtualmachineid, **kwargs):
-        cmd = removeNicFromVirtualMachine.removeNicFromVirtualMachineCmd()
-        cmd.id = self.id
-        cmd.nicid = nicid
-        cmd.virtualmachineid = virtualmachineid
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        nicfromvirtualmachine = apiclient.removeNicFromVirtualMachine(cmd)
-        return nicfromvirtualmachine
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/NicToVirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/NicToVirtualMachine.py b/tools/marvin/marvin/integration/lib/base/NicToVirtualMachine.py
deleted file mode 100644
index 00dcb9e..0000000
--- a/tools/marvin/marvin/integration/lib/base/NicToVirtualMachine.py
+++ /dev/null
@@ -1,35 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import addNicToVirtualMachine
-
-class NicToVirtualMachine(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def add(self, apiclient, networkid, virtualmachineid, **kwargs):
-        cmd = addNicToVirtualMachine.addNicToVirtualMachineCmd()
-        cmd.id = self.id
-        cmd.networkid = networkid
-        cmd.virtualmachineid = virtualmachineid
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        nictovirtualmachine = apiclient.addNicToVirtualMachine(cmd)
-        return nictovirtualmachine
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/NiciraNvpDevice.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/NiciraNvpDevice.py b/tools/marvin/marvin/integration/lib/base/NiciraNvpDevice.py
index b85ebcb..e0af4b5 100644
--- a/tools/marvin/marvin/integration/lib/base/NiciraNvpDevice.py
+++ b/tools/marvin/marvin/integration/lib/base/NiciraNvpDevice.py
@@ -18,6 +18,7 @@ from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import addNiciraNvpDevice
 from marvin.cloudstackAPI import listNiciraNvpDevices
 from marvin.cloudstackAPI import deleteNiciraNvpDevice
+from marvin.cloudstackAPI import listNiciraNvpDeviceNetworks
 
 class NiciraNvpDevice(CloudStackEntity.CloudStackEntity):
 
@@ -55,3 +56,11 @@ class NiciraNvpDevice(CloudStackEntity.CloudStackEntity):
         niciranvpdevice = apiclient.deleteNiciraNvpDevice(cmd)
         return niciranvpdevice
 
+    @classmethod
+    def listNetworks(self, apiclient, nvpdeviceid, **kwargs):
+        cmd = listNiciraNvpDeviceNetworks.listNiciraNvpDeviceNetworksCmd()
+        cmd.nvpdeviceid = nvpdeviceid
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        niciranvpdevicenetworks = apiclient.listNiciraNvpDeviceNetworks(cmd)
+        return map(lambda e: NiciraNvpDevice(e.__dict__), niciranvpdevicenetworks)
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/NiciraNvpDeviceNetworks.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/NiciraNvpDeviceNetworks.py b/tools/marvin/marvin/integration/lib/base/NiciraNvpDeviceNetworks.py
deleted file mode 100644
index 0ee75da..0000000
--- a/tools/marvin/marvin/integration/lib/base/NiciraNvpDeviceNetworks.py
+++ /dev/null
@@ -1,34 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import listNiciraNvpDeviceNetworks
-
-class NiciraNvpDeviceNetworks(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    @classmethod
-    def list(self, apiclient, nvpdeviceid, **kwargs):
-        cmd = listNiciraNvpDeviceNetworks.listNiciraNvpDeviceNetworksCmd()
-        cmd.nvpdeviceid = nvpdeviceid
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        niciranvpdevicenetworks = apiclient.listNiciraNvpDeviceNetworks(cmd)
-        return map(lambda e: NiciraNvpDeviceNetworks(e.__dict__), niciranvpdevicenetworks)
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/Nics.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Nics.py b/tools/marvin/marvin/integration/lib/base/Nics.py
deleted file mode 100644
index d31efde..0000000
--- a/tools/marvin/marvin/integration/lib/base/Nics.py
+++ /dev/null
@@ -1,34 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import listNics
-
-class Nics(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    @classmethod
-    def list(self, apiclient, virtualmachineid, **kwargs):
-        cmd = listNics.listNicsCmd()
-        cmd.virtualmachineid = virtualmachineid
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        nics = apiclient.listNics(cmd)
-        return map(lambda e: Nics(e.__dict__), nics)
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/PasswordForVirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/PasswordForVirtualMachine.py b/tools/marvin/marvin/integration/lib/base/PasswordForVirtualMachine.py
deleted file mode 100644
index 692d6f4..0000000
--- a/tools/marvin/marvin/integration/lib/base/PasswordForVirtualMachine.py
+++ /dev/null
@@ -1,34 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import resetPasswordForVirtualMachine
-
-class PasswordForVirtualMachine(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def reset(self, apiclient, id, **kwargs):
-        cmd = resetPasswordForVirtualMachine.resetPasswordForVirtualMachineCmd()
-        cmd.id = self.id
-        cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        passwordforvirtualmachine = apiclient.resetPasswordForVirtualMachine(cmd)
-        return passwordforvirtualmachine
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/PhysicalNetwork.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/PhysicalNetwork.py b/tools/marvin/marvin/integration/lib/base/PhysicalNetwork.py
index f076236..329393a 100644
--- a/tools/marvin/marvin/integration/lib/base/PhysicalNetwork.py
+++ b/tools/marvin/marvin/integration/lib/base/PhysicalNetwork.py
@@ -44,19 +44,17 @@ class PhysicalNetwork(CloudStackEntity.CloudStackEntity):
         return map(lambda e: PhysicalNetwork(e.__dict__), physicalnetwork)
 
 
-    def update(self, apiclient, id, **kwargs):
+    def update(self, apiclient, **kwargs):
         cmd = updatePhysicalNetwork.updatePhysicalNetworkCmd()
         cmd.id = self.id
-        cmd.id = id
         [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         physicalnetwork = apiclient.updatePhysicalNetwork(cmd)
         return physicalnetwork
 
 
-    def delete(self, apiclient, id, **kwargs):
+    def delete(self, apiclient, **kwargs):
         cmd = deletePhysicalNetwork.deletePhysicalNetworkCmd()
         cmd.id = self.id
-        cmd.id = id
         [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         physicalnetwork = apiclient.deletePhysicalNetwork(cmd)
         return physicalnetwork

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/Pod.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Pod.py b/tools/marvin/marvin/integration/lib/base/Pod.py
index 7258fc4..9d8d885 100644
--- a/tools/marvin/marvin/integration/lib/base/Pod.py
+++ b/tools/marvin/marvin/integration/lib/base/Pod.py
@@ -44,19 +44,17 @@ class Pod(CloudStackEntity.CloudStackEntity):
         return map(lambda e: Pod(e.__dict__), pod)
 
 
-    def update(self, apiclient, id, **kwargs):
+    def update(self, apiclient, **kwargs):
         cmd = updatePod.updatePodCmd()
         cmd.id = self.id
-        cmd.id = id
         [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         pod = apiclient.updatePod(cmd)
         return pod
 
 
-    def delete(self, apiclient, id, **kwargs):
+    def delete(self, apiclient, **kwargs):
         cmd = deletePod.deletePodCmd()
         cmd.id = self.id
-        cmd.id = id
         [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         pod = apiclient.deletePod(cmd)
         return pod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/PortForwardingRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/PortForwardingRule.py b/tools/marvin/marvin/integration/lib/base/PortForwardingRule.py
index c45bada..9cf58d9 100644
--- a/tools/marvin/marvin/integration/lib/base/PortForwardingRule.py
+++ b/tools/marvin/marvin/integration/lib/base/PortForwardingRule.py
@@ -56,10 +56,9 @@ class PortForwardingRule(CloudStackEntity.CloudStackEntity):
         return portforwardingrule
 
 
-    def delete(self, apiclient, id, **kwargs):
+    def delete(self, apiclient, **kwargs):
         cmd = deletePortForwardingRule.deletePortForwardingRuleCmd()
         cmd.id = self.id
-        cmd.id = id
         [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         portforwardingrule = apiclient.deletePortForwardingRule(cmd)
         return portforwardingrule

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/PrivateGateway.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/PrivateGateway.py b/tools/marvin/marvin/integration/lib/base/PrivateGateway.py
index bc4cf01..707c33f 100644
--- a/tools/marvin/marvin/integration/lib/base/PrivateGateway.py
+++ b/tools/marvin/marvin/integration/lib/base/PrivateGateway.py
@@ -43,10 +43,9 @@ class PrivateGateway(CloudStackEntity.CloudStackEntity):
         return map(lambda e: PrivateGateway(e.__dict__), privategateway)
 
 
-    def delete(self, apiclient, id, **kwargs):
+    def delete(self, apiclient, **kwargs):
         cmd = deletePrivateGateway.deletePrivateGatewayCmd()
         cmd.id = self.id
-        cmd.id = id
         [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         privategateway = apiclient.deletePrivateGateway(cmd)
         return privategateway

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/Project.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Project.py b/tools/marvin/marvin/integration/lib/base/Project.py
index dfadbb3..243d22d 100644
--- a/tools/marvin/marvin/integration/lib/base/Project.py
+++ b/tools/marvin/marvin/integration/lib/base/Project.py
@@ -21,6 +21,9 @@ from marvin.cloudstackAPI import listProjects
 from marvin.cloudstackAPI import updateProject
 from marvin.cloudstackAPI import activateProject
 from marvin.cloudstackAPI import deleteProject
+from marvin.cloudstackAPI import deleteAccountFromProject
+from marvin.cloudstackAPI import addAccountToProject
+from marvin.cloudstackAPI import listProjectAccounts
 
 class Project(CloudStackEntity.CloudStackEntity):
 
@@ -29,10 +32,9 @@ class Project(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def suspend(self, apiclient, id, **kwargs):
+    def suspend(self, apiclient, **kwargs):
         cmd = suspendProject.suspendProjectCmd()
         cmd.id = self.id
-        cmd.id = id
         [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         project = apiclient.suspendProject(cmd)
         return project
@@ -55,29 +57,51 @@ class Project(CloudStackEntity.CloudStackEntity):
         return map(lambda e: Project(e.__dict__), project)
 
 
-    def update(self, apiclient, id, **kwargs):
+    def update(self, apiclient, **kwargs):
         cmd = updateProject.updateProjectCmd()
         cmd.id = self.id
-        cmd.id = id
         [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         project = apiclient.updateProject(cmd)
         return project
 
 
-    def activate(self, apiclient, id, **kwargs):
+    def activate(self, apiclient, **kwargs):
         cmd = activateProject.activateProjectCmd()
         cmd.id = self.id
-        cmd.id = id
         [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         project = apiclient.activateProject(cmd)
         return project
 
 
-    def delete(self, apiclient, id, **kwargs):
+    def delete(self, apiclient, **kwargs):
         cmd = deleteProject.deleteProjectCmd()
         cmd.id = self.id
-        cmd.id = id
         [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         project = apiclient.deleteProject(cmd)
         return project
 
+
+    def delete_account(self, apiclient, projectid, **kwargs):
+        cmd = deleteAccountFromProject.deleteAccountFromProjectCmd()
+        cmd.id = self.id
+        cmd.projectid = projectid
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        deletefromproject = apiclient.deleteAccountFromProject(cmd)
+        return deletefromproject
+
+
+    def add_account(self, apiclient, projectid, **kwargs):
+        cmd = addAccountToProject.addAccountToProjectCmd()
+        cmd.id = self.id
+        cmd.projectid = projectid
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        accounttoproject = apiclient.addAccountToProject(cmd)
+        return accounttoproject
+
+    @classmethod
+    def list_accounts(self, apiclient, projectid, **kwargs):
+        cmd = listProjectAccounts.listProjectAccountsCmd()
+        cmd.projectid = projectid
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        projectaccounts = apiclient.listProjectAccounts(cmd)
+        return map(lambda e: Project(e.__dict__), projectaccounts)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/ProjectAccounts.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ProjectAccounts.py b/tools/marvin/marvin/integration/lib/base/ProjectAccounts.py
deleted file mode 100644
index a325130..0000000
--- a/tools/marvin/marvin/integration/lib/base/ProjectAccounts.py
+++ /dev/null
@@ -1,34 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import listProjectAccounts
-
-class ProjectAccounts(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    @classmethod
-    def list(self, apiclient, projectid, **kwargs):
-        cmd = listProjectAccounts.listProjectAccountsCmd()
-        cmd.projectid = projectid
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        projectaccounts = apiclient.listProjectAccounts(cmd)
-        return map(lambda e: ProjectAccounts(e.__dict__), projectaccounts)
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/Remove.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Remove.py b/tools/marvin/marvin/integration/lib/base/Remove.py
deleted file mode 100644
index 616d94e..0000000
--- a/tools/marvin/marvin/integration/lib/base/Remove.py
+++ /dev/null
@@ -1,33 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import ldapRemove
-
-class Remove(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def ldap(self, apiclient, **kwargs):
-        cmd = ldapRemove.ldapRemoveCmd()
-        cmd.id = self.id
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        remove = apiclient.ldapRemove(cmd)
-        return remove
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/SSHKeyForVirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SSHKeyForVirtualMachine.py b/tools/marvin/marvin/integration/lib/base/SSHKeyForVirtualMachine.py
deleted file mode 100644
index 40e5712..0000000
--- a/tools/marvin/marvin/integration/lib/base/SSHKeyForVirtualMachine.py
+++ /dev/null
@@ -1,35 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import resetSSHKeyForVirtualMachine
-
-class SSHKeyForVirtualMachine(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def reset(self, apiclient, keypair, id, **kwargs):
-        cmd = resetSSHKeyForVirtualMachine.resetSSHKeyForVirtualMachineCmd()
-        cmd.id = self.id
-        cmd.id = id
-        cmd.keypair = keypair
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        sshkeyforvirtualmachine = apiclient.resetSSHKeyForVirtualMachine(cmd)
-        return sshkeyforvirtualmachine
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/SecurityGroup.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SecurityGroup.py b/tools/marvin/marvin/integration/lib/base/SecurityGroup.py
index 38e0d4a..e532eef 100644
--- a/tools/marvin/marvin/integration/lib/base/SecurityGroup.py
+++ b/tools/marvin/marvin/integration/lib/base/SecurityGroup.py
@@ -18,6 +18,10 @@ from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import createSecurityGroup
 from marvin.cloudstackAPI import listSecurityGroups
 from marvin.cloudstackAPI import deleteSecurityGroup
+from marvin.cloudstackAPI import revokeSecurityGroupEgress
+from marvin.cloudstackAPI import revokeSecurityGroupIngress
+from marvin.cloudstackAPI import authorizeSecurityGroupEgress
+from marvin.cloudstackAPI import authorizeSecurityGroupIngress
 
 class SecurityGroup(CloudStackEntity.CloudStackEntity):
 
@@ -50,3 +54,29 @@ class SecurityGroup(CloudStackEntity.CloudStackEntity):
         securitygroup = apiclient.deleteSecurityGroup(cmd)
         return securitygroup
 
+
+    def authorize(self, apiclient, ingress=True, **kwargs):
+        if ingress:
+            cmd = authorizeSecurityGroupIngress.authorizeSecurityGroupIngressCmd()
+        else:
+            cmd = authorizeSecurityGroupEgress.authorizeSecurityGroupEgressCmd()
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        if ingress:
+            return apiclient.authorizeSecurityGroupIngress(cmd)
+        else:
+            return apiclient.authorizeSecurityGroupEgress(cmd)
+
+
+    def revoke(self, apiclient, ingress=True, **kwargs):
+        if ingress:
+            cmd = revokeSecurityGroupIngress.revokeSecurityGroupIngressCmd()
+        else:
+            cmd = revokeSecurityGroupEgress.revokeSecurityGroupEgressCmd()
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        if ingress:
+            return apiclient.revokeSecurityGroupIngress(cmd)
+        else:
+            return apiclient.revokeSecurityGroupEgress(cmd)
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/SecurityGroupEgress.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SecurityGroupEgress.py b/tools/marvin/marvin/integration/lib/base/SecurityGroupEgress.py
deleted file mode 100644
index 27dd5e3..0000000
--- a/tools/marvin/marvin/integration/lib/base/SecurityGroupEgress.py
+++ /dev/null
@@ -1,43 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import authorizeSecurityGroupEgress
-from marvin.cloudstackAPI import revokeSecurityGroupEgress
-
-class SecurityGroupEgress(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def authorize(self, apiclient, **kwargs):
-        cmd = authorizeSecurityGroupEgress.authorizeSecurityGroupEgressCmd()
-        cmd.id = self.id
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        securitygroupegress = apiclient.authorizeSecurityGroupEgress(cmd)
-        return securitygroupegress
-
-
-    def revoke(self, apiclient, id, **kwargs):
-        cmd = revokeSecurityGroupEgress.revokeSecurityGroupEgressCmd()
-        cmd.id = self.id
-        cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        securitygroupegress = apiclient.revokeSecurityGroupEgress(cmd)
-        return securitygroupegress
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/SecurityGroupIngress.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SecurityGroupIngress.py b/tools/marvin/marvin/integration/lib/base/SecurityGroupIngress.py
deleted file mode 100644
index 5ada4a4..0000000
--- a/tools/marvin/marvin/integration/lib/base/SecurityGroupIngress.py
+++ /dev/null
@@ -1,43 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import authorizeSecurityGroupIngress
-from marvin.cloudstackAPI import revokeSecurityGroupIngress
-
-class SecurityGroupIngress(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    def authorize(self, apiclient, **kwargs):
-        cmd = authorizeSecurityGroupIngress.authorizeSecurityGroupIngressCmd()
-        cmd.id = self.id
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        securitygroupingress = apiclient.authorizeSecurityGroupIngress(cmd)
-        return securitygroupingress
-
-
-    def revoke(self, apiclient, id, **kwargs):
-        cmd = revokeSecurityGroupIngress.revokeSecurityGroupIngressCmd()
-        cmd.id = self.id
-        cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        securitygroupingress = apiclient.revokeSecurityGroupIngress(cmd)
-        return securitygroupingress
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/Snapshot.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Snapshot.py b/tools/marvin/marvin/integration/lib/base/Snapshot.py
index b69228a..1739b9c 100644
--- a/tools/marvin/marvin/integration/lib/base/Snapshot.py
+++ b/tools/marvin/marvin/integration/lib/base/Snapshot.py
@@ -43,10 +43,9 @@ class Snapshot(CloudStackEntity.CloudStackEntity):
         return map(lambda e: Snapshot(e.__dict__), snapshot)
 
 
-    def delete(self, apiclient, id, **kwargs):
+    def delete(self, apiclient, **kwargs):
         cmd = deleteSnapshot.deleteSnapshotCmd()
         cmd.id = self.id
-        cmd.id = id
         [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         snapshot = apiclient.deleteSnapshot(cmd)
         return snapshot

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbc5ffa1/tools/marvin/marvin/integration/lib/base/SnapshotPolicies.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SnapshotPolicies.py b/tools/marvin/marvin/integration/lib/base/SnapshotPolicies.py
deleted file mode 100644
index 5daa7cc..0000000
--- a/tools/marvin/marvin/integration/lib/base/SnapshotPolicies.py
+++ /dev/null
@@ -1,43 +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.
-from marvin.integration.lib.base import CloudStackEntity
-from marvin.cloudstackAPI import listSnapshotPolicies
-from marvin.cloudstackAPI import deleteSnapshotPolicies
-
-class SnapshotPolicies(CloudStackEntity.CloudStackEntity):
-
-
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
-    @classmethod
-    def list(self, apiclient, volumeid, **kwargs):
-        cmd = listSnapshotPolicies.listSnapshotPoliciesCmd()
-        cmd.volumeid = volumeid
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        snapshotpolicies = apiclient.listSnapshotPolicies(cmd)
-        return map(lambda e: SnapshotPolicies(e.__dict__), snapshotpolicies)
-
-
-    def delete(self, apiclient, **kwargs):
-        cmd = deleteSnapshotPolicies.deleteSnapshotPoliciesCmd()
-        cmd.id = self.id
-        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
-        snapshotpolicies = apiclient.deleteSnapshotPolicies(cmd)
-        return snapshotpolicies
-


[18/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
CLOUDSTACK-1065: cloudstack UI - AWS Style Regions - when switching to another region, handle a case that the region's end point is not "http://hostname:port/client/"


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

Branch: refs/heads/marvin_refactor
Commit: f4fad9e2c753c5c0e8120170268e9e06efcf1575
Parents: 5f482f5
Author: Jessica Wang <je...@citrix.com>
Authored: Mon Mar 25 15:30:01 2013 -0700
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:03:10 2013 +0530

----------------------------------------------------------------------
 ui/scripts/cloud.core.callbacks.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f4fad9e2/ui/scripts/cloud.core.callbacks.js
----------------------------------------------------------------------
diff --git a/ui/scripts/cloud.core.callbacks.js b/ui/scripts/cloud.core.callbacks.js
index 19d759e..07994f2 100644
--- a/ui/scripts/cloud.core.callbacks.js
+++ b/ui/scripts/cloud.core.callbacks.js
@@ -59,9 +59,9 @@ $(document).ready(function() {
 	*/
 	if ($.urlParam('loginUrl') != 0) {
 		$.cookie('loginUrl', $.urlParam('loginUrl'), { expires: 1});
-	  document.location.href = '/client/';
+		document.location.href = window.location.href.substring(0, window.location.href.indexOf('?'));
 	}
-	
+
 	/*
 	condition 2: If window.location.href does not contain parameter 'loginUrl' but cookie 'loginUrl' exists,
 	save the cookie's value to g_regionUrlParam (a global variable for switching regions),


[14/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
CLOUDSTACK-1065: cloudstack UI - AWS Style Regions - remove region action - removing the region that you are currently in is not allowed.


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

Branch: refs/heads/marvin_refactor
Commit: 7c02636e5e0b708f8f946932dcea88e69ae5d06b
Parents: 4d3a999
Author: Jessica Wang <je...@citrix.com>
Authored: Wed Mar 20 15:19:36 2013 -0700
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:02:01 2013 +0530

----------------------------------------------------------------------
 ui/scripts/regions.js           |   10 +++++++++-
 ui/scripts/ui-custom/regions.js |    2 +-
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7c02636e/ui/scripts/regions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/regions.js b/ui/scripts/regions.js
index 6e87c7f..edc96cb 100644
--- a/ui/scripts/regions.js
+++ b/ui/scripts/regions.js
@@ -70,7 +70,7 @@
               success: function(json) {
                 var item = json.addregionresponse.region;
                 args.response.success({data: item});
-                //$(window).trigger('cloudStack.refreshRegions');
+                $(window).trigger('cloudStack.refreshRegions');
               },
               error: function(json) {
                 args.response.error(parseXMLHttpResponse(json));
@@ -124,6 +124,14 @@
               notification: function() { return 'label.remove.region'; },
               confirm: function() { return 'message.remove.region'; }
             },
+						preAction: function(args) {
+						  var region = args.context.regions[0];
+							if(region.endpoint == document.location.href) {
+							  cloudStack.dialog.notice({ message: _l('You can not remove the region that you are currently in.') });
+                return false;
+							}
+              return true;
+            },
             action: function(args) {
               var region = args.context.regions[0];
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7c02636e/ui/scripts/ui-custom/regions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/regions.js b/ui/scripts/ui-custom/regions.js
index 611edda..819dfd0 100644
--- a/ui/scripts/ui-custom/regions.js
+++ b/ui/scripts/ui-custom/regions.js
@@ -37,7 +37,7 @@
 
               $li.data('region-data', region);
 
-							if(document.location.href == region.endpoint) {
+							if(region.endpoint == document.location.href) {
                 currentRegion = region;
 								$li.addClass('active');
 							}


[17/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
appliance: veewee definition to build devcloud, work in progress

forked from systemvmtemplate

Signed-off-by: Rohit Yadav <bh...@apache.org>


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

Branch: refs/heads/marvin_refactor
Commit: 5f482f55cfefeb2dd837428c039277d6cb80c8bc
Parents: fc946ae
Author: Rohit Yadav <bh...@apache.org>
Authored: Mon Mar 25 13:26:51 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:03:10 2013 +0530

----------------------------------------------------------------------
 tools/appliance/definitions/devcloud/cleanup.sh |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5f482f55/tools/appliance/definitions/devcloud/cleanup.sh
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/devcloud/cleanup.sh b/tools/appliance/definitions/devcloud/cleanup.sh
index 9e98ab0..0cdb547 100644
--- a/tools/appliance/definitions/devcloud/cleanup.sh
+++ b/tools/appliance/definitions/devcloud/cleanup.sh
@@ -18,4 +18,3 @@ rm /lib/udev/rules.d/75-persistent-net-generator.rules
 
 echo "Adding a 2 sec delay to the interface up, to make the dhclient happy"
 echo "pre-up sleep 2" >> /etc/network/interfaces
-


[30/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
Fixes/improvements for VPC feature:

1) Added comments to VPC/VPCService/VPCManager interfaces
2) Moved VPC offering related methods from VpcService to the new interface - VpcProvisioningService
3) Fixed static nat creation in the VPC - used to result in NPE due to invalid method referencing while obtaining VPC VR information


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

Branch: refs/heads/marvin_refactor
Commit: 9e38c5df0fa0db3ab7056e78d68562a8df8ebe70
Parents: cb4ac1f
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Fri Mar 29 16:24:24 2013 -0700
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:19:14 2013 +0530

----------------------------------------------------------------------
 api/src/com/cloud/network/NetworkModel.java        |    2 +
 api/src/com/cloud/network/vpc/Vpc.java             |   26 +++---
 api/src/com/cloud/network/vpc/VpcOffering.java     |   10 +-
 .../cloud/network/vpc/VpcProvisioningService.java  |   10 +-
 api/src/com/cloud/network/vpc/VpcService.java      |   74 +++++++-------
 .../api/command/user/network/UpdateNetworkCmd.java |    2 +-
 server/src/com/cloud/network/NetworkManager.java   |    4 +-
 .../src/com/cloud/network/NetworkManagerImpl.java  |    1 -
 server/src/com/cloud/network/NetworkModelImpl.java |   13 +++
 .../src/com/cloud/network/NetworkServiceImpl.java  |    6 +
 .../router/VpcVirtualNetworkApplianceManager.java  |    2 +-
 server/src/com/cloud/network/vpc/VpcManager.java   |   26 +++---
 .../src/com/cloud/network/vpc/VpcManagerImpl.java  |   10 +-
 .../com/cloud/network/MockNetworkModelImpl.java    |    6 +
 .../test/com/cloud/vpc/MockNetworkModelImpl.java   |    6 +
 server/test/com/cloud/vpc/MockVpcManagerImpl.java  |    2 +-
 16 files changed, 115 insertions(+), 85 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/api/src/com/cloud/network/NetworkModel.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/NetworkModel.java b/api/src/com/cloud/network/NetworkModel.java
index 916f28a..c1f1674 100644
--- a/api/src/com/cloud/network/NetworkModel.java
+++ b/api/src/com/cloud/network/NetworkModel.java
@@ -261,4 +261,6 @@ public interface NetworkModel {
 	String getStartIpv6Address(long id);
 
     Nic getPlaceholderNic(Network network, Long podId);
+
+    boolean isProviderEnabledInZone(long zoneId, String provider);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/api/src/com/cloud/network/vpc/Vpc.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/vpc/Vpc.java b/api/src/com/cloud/network/vpc/Vpc.java
index 249e80f..cfeaf5a 100644
--- a/api/src/com/cloud/network/vpc/Vpc.java
+++ b/api/src/com/cloud/network/vpc/Vpc.java
@@ -21,60 +21,60 @@ import org.apache.cloudstack.api.Identity;
 import org.apache.cloudstack.api.InternalIdentity;
 
 public interface Vpc extends ControlledEntity, Identity, InternalIdentity {
-    
+
     public enum State {
         Enabled,
         Inactive
     }
 
     /**
-     * 
+     *
      * @return VPC name
      */
    String getName();
 
-   
+
    /**
     * @return the id of the zone the VPC belongs to
     */
    long getZoneId();
 
-   
+
    /**
     * @return super CIDR of the VPC. All the networks participating in VPC, should have CIDRs that are the part of the super cidr
     */
    String getCidr();
 
    /**
-    * 
+    *
     * @return VPC state
     */
    State getState();
 
-   
+
    /**
-    * 
+    *
     * @return VPC offering id - the offering that VPC is created from
     */
    long getVpcOfferingId();
 
-   
+
    /**
-    * 
+    *
     * @return VPC display text
     */
    String getDisplayText();
 
-   
+
    /**
-    * 
+    *
     * @return VPC network domain. All networks participating in the VPC, become the part of the same network domain
     */
    String getNetworkDomain();
 
-   
+
    /**
-    * 
+    *
     * @return true if restart is required for the VPC; false otherwise
     */
    boolean isRestartRequired();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/api/src/com/cloud/network/vpc/VpcOffering.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/vpc/VpcOffering.java b/api/src/com/cloud/network/vpc/VpcOffering.java
index 3961d0a..1c65a40 100644
--- a/api/src/com/cloud/network/vpc/VpcOffering.java
+++ b/api/src/com/cloud/network/vpc/VpcOffering.java
@@ -28,26 +28,26 @@ public interface VpcOffering extends InternalIdentity, Identity {
     public static final String defaultVPCOfferingName = "Default VPC offering";
 
     /**
-     * 
+     *
      * @return VPC offering name
      */
     String getName();
 
-    
+
     /**
      * @return VPC offering display text
      */
     String getDisplayText();
-    
+
 
     /**
-     * 
+     *
      * @return VPC offering state
      */
     State getState();
 
     /**
-     * 
+     *
      * @return true if offering is default - came with the cloudStack fresh install; false otherwise
      */
     boolean isDefault();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/api/src/com/cloud/network/vpc/VpcProvisioningService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/vpc/VpcProvisioningService.java b/api/src/com/cloud/network/vpc/VpcProvisioningService.java
index 70676ce..2452d92 100644
--- a/api/src/com/cloud/network/vpc/VpcProvisioningService.java
+++ b/api/src/com/cloud/network/vpc/VpcProvisioningService.java
@@ -20,20 +20,20 @@ import java.util.List;
 import java.util.Map;
 
 public interface VpcProvisioningService {
-    
+
     public VpcOffering getVpcOffering(long vpcOfferingId);
-    
+
     public VpcOffering createVpcOffering(String name, String displayText, List<String> supportedServices, Map<String, List<String>> serviceProviders);
-    
+
     List<? extends VpcOffering> listVpcOfferings(Long id, String name, String displayText, List<String> supportedServicesStr,
             Boolean isDefault, String keyword, String state, Long startIndex, Long pageSizeVal);
-    
+
     /**
      * @param offId
      * @return
      */
     public boolean deleteVpcOffering(long offId);
-    
+
     /**
      * @param vpcOffId
      * @param vpcOfferingName

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/api/src/com/cloud/network/vpc/VpcService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/vpc/VpcService.java b/api/src/com/cloud/network/vpc/VpcService.java
index 07ce89b..cbec3ed 100644
--- a/api/src/com/cloud/network/vpc/VpcService.java
+++ b/api/src/com/cloud/network/vpc/VpcService.java
@@ -35,16 +35,16 @@ import com.cloud.utils.Pair;
 public interface VpcService {
 
     /**Returns existing VPC found by id
-     * 
+     *
      * @param vpcId
      * @return
      */
     public Vpc getVpc(long vpcId);
 
-    
+
     /**
      * Returns all the Guest networks that are part of VPC
-     * 
+     *
      * @param vpcId
      * @return
      */
@@ -52,7 +52,7 @@ public interface VpcService {
 
     /**
      * Persists VPC record in the database
-     * 
+     *
      * @param zoneId
      * @param vpcOffId
      * @param vpcOwnerId
@@ -66,10 +66,10 @@ public interface VpcService {
     public Vpc createVpc(long zoneId, long vpcOffId, long vpcOwnerId, String vpcName, String displayText, String cidr,
             String networkDomain) throws ResourceAllocationException;
 
-    
+
     /**
      * Deletes a VPC
-     * 
+     *
      * @param vpcId
      * @return
      * @throws InsufficientCapacityException
@@ -78,10 +78,10 @@ public interface VpcService {
      */
     public boolean deleteVpc(long vpcId) throws ConcurrentOperationException, ResourceUnavailableException;
 
-    
+
     /**
      * Updates VPC with new name/displayText
-     * 
+     *
      * @param vpcId
      * @param vpcName
      * @param displayText
@@ -89,10 +89,10 @@ public interface VpcService {
      */
     public Vpc updateVpc(long vpcId, String vpcName, String displayText);
 
-    
+
     /**
      * Lists VPC(s) based on the parameters passed to the method call
-     * 
+     *
      * @param id
      * @param vpcName
      * @param displayText
@@ -120,7 +120,7 @@ public interface VpcService {
 
     /**
      * Starts VPC which includes starting VPC provider and applying all the neworking rules on the backend
-     * 
+     *
      * @param vpcId
      * @param destroyOnFailure TODO
      * @return
@@ -133,7 +133,7 @@ public interface VpcService {
 
     /**
      * Shuts down the VPC which includes shutting down all VPC provider and rules cleanup on the backend
-     * 
+     *
      * @param vpcId
      * @return
      * @throws ConcurrentOperationException
@@ -141,10 +141,10 @@ public interface VpcService {
      */
     boolean shutdownVpc(long vpcId) throws ConcurrentOperationException, ResourceUnavailableException;
 
-    
+
     /**
      * Restarts the VPC. VPC gets shutdown and started as a part of it
-     * 
+     *
      * @param id
      * @return
      * @throws InsufficientCapacityException
@@ -153,16 +153,16 @@ public interface VpcService {
 
     /**
      * Returns a Private gateway found in the VPC by id
-     * 
+     *
      * @param id
      * @return
      */
     PrivateGateway getVpcPrivateGateway(long id);
 
-    
+
     /**
      * Persists VPC private gateway in the Database.
-     * 
+     *
      * @param vpcId TODO
      * @param physicalNetworkId
      * @param vlan
@@ -181,7 +181,7 @@ public interface VpcService {
 
     /**
      * Applies VPC private gateway on the backend, so it becomes functional
-     * 
+     *
      * @param gatewayId
      * @param destroyOnFailure TODO
      * @return
@@ -190,10 +190,10 @@ public interface VpcService {
      */
     public PrivateGateway applyVpcPrivateGateway(long gatewayId, boolean destroyOnFailure) throws ConcurrentOperationException, ResourceUnavailableException;
 
-    
+
     /**
      * Deletes VPC private gateway
-     * 
+     *
      * @param id
      * @return
      * @throws ResourceUnavailableException
@@ -201,76 +201,76 @@ public interface VpcService {
      */
     boolean deleteVpcPrivateGateway(long gatewayId) throws ConcurrentOperationException, ResourceUnavailableException;
 
-    
+
     /**
      * Returns the list of Private gateways existing in the VPC
-     * 
+     *
      * @param listPrivateGatewaysCmd
      * @return
      */
     public Pair<List<PrivateGateway>, Integer> listPrivateGateway(ListPrivateGatewaysCmd listPrivateGatewaysCmd);
 
-    
+
     /**
      * Returns Static Route found by Id
-     * 
+     *
      * @param routeId
      * @return
      */
     StaticRoute getStaticRoute(long routeId);
 
-    
+
     /**
      * Applies existing Static Routes to the VPC elements
-     * 
+     *
      * @param vpcId
      * @return
      * @throws ResourceUnavailableException
      */
     public boolean applyStaticRoutes(long vpcId) throws ResourceUnavailableException;
 
-    
+
     /**
      * Deletes static route from the backend and the database
-     * 
+     *
      * @param routeId
      * @return TODO
      * @throws ResourceUnavailableException
      */
     public boolean revokeStaticRoute(long routeId) throws ResourceUnavailableException;
 
-    
+
     /**
      * Persists static route entry in the Database
-     * 
+     *
      * @param gatewayId
      * @param cidr
      * @return
      */
     public StaticRoute createStaticRoute(long gatewayId, String cidr) throws NetworkRuleConflictException;
 
-    
+
     /**
      * Lists static routes based on parameters passed to the call
-     * 
+     *
      * @param listStaticRoutesCmd
      * @return
      */
     public Pair<List<? extends StaticRoute>, Integer> listStaticRoutes(ListStaticRoutesCmd cmd);
 
-    
+
     /**
-     * Returns gateway (VPN or Public) existign in the VPC 
-     * 
+     * Returns gateway (VPN or Public) existign in the VPC
+     *
      * @param id
      * @return
      */
     VpcGateway getVpcGateway(long id);
 
-    
+
     /**
      * Associates IP address from the Public network, to the VPC
-     * 
+     *
      * @param ipId
      * @param vpcId
      * @return

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
index a61474e..f47e9e6 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
@@ -131,7 +131,7 @@ public class UpdateNetworkCmd extends BaseAsyncCmd {
 
         Network result = _networkService.updateGuestNetwork(getId(), getNetworkName(), getDisplayText(), callerAccount,
                     callerUser, getNetworkDomain(), getNetworkOfferingId(), getChangeCidr(), getGuestVmCidr());
-        
+
 
         if (result != null) {
             NetworkResponse response = _responseGenerator.createNetworkResponse(result);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/server/src/com/cloud/network/NetworkManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManager.java b/server/src/com/cloud/network/NetworkManager.java
index e961f04..851f7f5 100755
--- a/server/src/com/cloud/network/NetworkManager.java
+++ b/server/src/com/cloud/network/NetworkManager.java
@@ -20,8 +20,8 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.cloudstack.acl.ControlledEntity.ACLType;
+
 import com.cloud.dc.DataCenter;
-import com.cloud.dc.DataCenterVO;
 import com.cloud.dc.Pod;
 import com.cloud.dc.Vlan.VlanType;
 import com.cloud.deploy.DataCenterDeployment;
@@ -51,13 +51,11 @@ import com.cloud.user.User;
 import com.cloud.utils.Pair;
 import com.cloud.vm.Nic;
 import com.cloud.vm.NicProfile;
-import com.cloud.vm.NicSecondaryIp;
 import com.cloud.vm.NicVO;
 import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VMInstanceVO;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
-import com.cloud.vm.VirtualMachineProfileImpl;
 
 /**
  * NetworkManager manages the network for the different end users.

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java
index e980b0f..08a3400 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -1528,7 +1528,6 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
         // associate a source NAT IP (if one isn't already associated with the network)
 
         boolean sharedSourceNat = offering.getSharedSourceNat();
-        DataCenter zone = _dcDao.findById(network.getDataCenterId());
         if (network.getGuestType() == Network.GuestType.Isolated
                && _networkModel.areServicesSupportedInNetwork(network.getId(), Service.SourceNat)
                && !sharedSourceNat) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/server/src/com/cloud/network/NetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkModelImpl.java b/server/src/com/cloud/network/NetworkModelImpl.java
index e45818f..e867641 100644
--- a/server/src/com/cloud/network/NetworkModelImpl.java
+++ b/server/src/com/cloud/network/NetworkModelImpl.java
@@ -1214,6 +1214,19 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel {
     }
 
     @Override
+    public boolean isProviderEnabledInZone(long zoneId, String provider)
+    {
+        //the provider has to be enabled at least in one network in the zone
+        for (PhysicalNetwork pNtwk : _physicalNetworkDao.listByZone(zoneId)) {
+            if (isProviderEnabledInPhysicalNetwork(pNtwk.getId(), provider)) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    @Override
     public String getNetworkTag(HypervisorType hType, Network network) {
         // no network tag for control traffic type
         TrafficType effectiveTrafficType = network.getTrafficType();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java
index d503459..8d555c1 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -1723,6 +1723,12 @@ public class NetworkServiceImpl extends ManagerBase implements  NetworkService {
             _vpcMgr.validateNtwkOffForNtwkInVpc(networkId, networkOfferingId, null, null, vpc, null, _accountMgr.getAccount(network.getAccountId()));
         }
 
+        //perform below validation if the network is vpc network
+        if (network.getVpcId() != null && networkOfferingId != null) {
+            Vpc vpc = _vpcMgr.getVpc(network.getVpcId());
+            _vpcMgr.validateNtwkOffForNtwkInVpc(networkId, networkOfferingId, null, null, vpc, null, _accountMgr.getAccount(network.getAccountId()));
+        }
+
         // don't allow to update network in Destroy state
         if (network.getState() == Network.State.Destroy) {
             throw new InvalidParameterValueException("Don't allow to update network in state " + Network.State.Destroy);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManager.java b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManager.java
index 76c8aa8..f59461c 100644
--- a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManager.java
+++ b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManager.java
@@ -101,7 +101,7 @@ public interface VpcVirtualNetworkApplianceManager extends VirtualNetworkApplian
      * @throws ResourceUnavailableException
      */
     boolean stopSite2SiteVpn(Site2SiteVpnConnection conn, VirtualRouter router) throws ResourceUnavailableException;
-    
+
     /**
      * @param vpcId
      * @return

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/server/src/com/cloud/network/vpc/VpcManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/VpcManager.java b/server/src/com/cloud/network/vpc/VpcManager.java
index 84ab8ef..686e18a 100644
--- a/server/src/com/cloud/network/vpc/VpcManager.java
+++ b/server/src/com/cloud/network/vpc/VpcManager.java
@@ -47,10 +47,10 @@ public interface VpcManager extends VpcService{
      */
     List<? extends Vpc> getVpcsForAccount(long accountId);
 
-    
+
     /**
      * Destroys the VPC
-     * 
+     *
      * @param vpc
      * @param caller TODO
      * @param callerUserId TODO
@@ -63,7 +63,7 @@ public interface VpcManager extends VpcService{
 
     /**
      * Returns true if the IP is allocated to the VPC; false otherwise
-     * 
+     *
      * @param ip
      * @return
      */
@@ -72,7 +72,7 @@ public interface VpcManager extends VpcService{
 
     /**
      * Disassociates the public IP address from VPC
-     * 
+     *
      * @param ipId
      * @param networkId
      */
@@ -81,7 +81,7 @@ public interface VpcManager extends VpcService{
 
     /**
      * Creates guest network in the VPC
-     * 
+     *
      * @param ntwkOffId
      * @param name
      * @param displayText
@@ -110,7 +110,7 @@ public interface VpcManager extends VpcService{
 
     /**
      * Assigns source nat public IP address to VPC
-     * 
+     *
      * @param owner
      * @param vpc
      * @return public IP address object
@@ -122,7 +122,7 @@ public interface VpcManager extends VpcService{
 
     /**
      * Validates network offering to find if it can be used for network creation in VPC
-     * 
+     *
      * @param guestNtwkOff
      * @param supportedSvcs TODO
      */
@@ -133,16 +133,16 @@ public interface VpcManager extends VpcService{
      * @return list of hypervisors that are supported by VPC
      */
     List<HypervisorType> getSupportedVpcHypervisors();
-    
-    
+
+
     /**
      * Lists all the services and providers that the current VPC suppots
      * @param vpcOffId
-     * @return map of Service to Provider(s) map 
+     * @return map of Service to Provider(s) map
      */
     Map<Service, Set<Provider>> getVpcOffSvcProvidersMap(long vpcOffId);
-    
-    
+
+
     /**
      * Returns VPC that is ready to be used
      * @param vpcId
@@ -152,7 +152,7 @@ public interface VpcManager extends VpcService{
 
 
     /**
-     * Performs network offering validation to determine if it can be used for network upgrade inside the VPC 
+     * Performs network offering validation to determine if it can be used for network upgrade inside the VPC
      * @param networkId
      * @param newNtwkOffId
      * @param newCidr

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/server/src/com/cloud/network/vpc/VpcManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
index 3948f2e..ec2564c 100644
--- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java
+++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
@@ -1002,7 +1002,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis
     
     @DB
     @Override
-    public void validateNtwkOffForNtwkInVpc(Long networkId, long newNtwkOffId, String newCidr, 
+    public void validateNtwkOffForNtwkInVpc(Long networkId, long newNtwkOffId, String newCidr,
             String newNetworkDomain, Vpc vpc, String gateway, Account networkOwner) {
         
         NetworkOffering guestNtwkOff = _configMgr.getNetworkOffering(newNtwkOffId);
@@ -1010,10 +1010,10 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis
         if (guestNtwkOff == null) {
             throw new InvalidParameterValueException("Can't find network offering by id specified");
         }
-        
+
         if (networkId == null) {
             //1) Validate attributes that has to be passed in when create new guest network
-            validateNewVpcGuestNetwork(newCidr, gateway, networkOwner, vpc, newNetworkDomain); 
+            validateNewVpcGuestNetwork(newCidr, gateway, networkOwner, vpc, newNetworkDomain);
         }
 
         //2) validate network offering attributes
@@ -1255,7 +1255,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis
         }  
     }
     
-    
+
     @Override
     public PrivateGateway getVpcPrivateGateway(long id) {
         VpcGateway gateway = _vpcGatewayDao.findById(id);
@@ -1996,7 +1996,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis
 
         return ipToReturn;
     }
-    
+
 
     @Override
     public List<HypervisorType> getSupportedVpcHypervisors() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/server/test/com/cloud/network/MockNetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/network/MockNetworkModelImpl.java b/server/test/com/cloud/network/MockNetworkModelImpl.java
index b926519..c578965 100644
--- a/server/test/com/cloud/network/MockNetworkModelImpl.java
+++ b/server/test/com/cloud/network/MockNetworkModelImpl.java
@@ -844,4 +844,10 @@ public class MockNetworkModelImpl extends ManagerBase implements NetworkModel {
         // TODO Auto-generated method stub
         return null;
     }
+
+    @Override
+    public boolean isProviderEnabledInZone(long zoneId, String provider) {
+        // TODO Auto-generated method stub
+        return false;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/server/test/com/cloud/vpc/MockNetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockNetworkModelImpl.java b/server/test/com/cloud/vpc/MockNetworkModelImpl.java
index b05e8ea..e1534cb 100644
--- a/server/test/com/cloud/vpc/MockNetworkModelImpl.java
+++ b/server/test/com/cloud/vpc/MockNetworkModelImpl.java
@@ -857,4 +857,10 @@ public class MockNetworkModelImpl extends ManagerBase implements NetworkModel {
         return null;
     }
 
+    @Override
+    public boolean isProviderEnabledInZone(long zoneId, String provider) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/server/test/com/cloud/vpc/MockVpcManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockVpcManagerImpl.java b/server/test/com/cloud/vpc/MockVpcManagerImpl.java
index 0f26928..44a3765 100644
--- a/server/test/com/cloud/vpc/MockVpcManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockVpcManagerImpl.java
@@ -380,7 +380,7 @@ public class MockVpcManagerImpl extends ManagerBase implements VpcManager {
     @Override
     public void validateNtwkOffForNtwkInVpc(Long networkId, long newNtwkOffId, String newCidr, String newNetworkDomain, Vpc vpc, String gateway, Account networkOwner) {
         // TODO Auto-generated method stub
-        
+
     }
 
 }


[25/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
CLOUDSTACK-1276, CLOUDSTACK-1729: Remove autoscanning, ensure adpater execution order in runtime


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

Branch: refs/heads/marvin_refactor
Commit: 646c4fb77ecaad026a3983cf70fb608a58159f00
Parents: 8821bfb
Author: Kelven Yang <ke...@gmail.com>
Authored: Thu Mar 21 20:21:11 2013 -0700
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:06:47 2013 +0530

----------------------------------------------------------------------
 client/tomcatconf/applicationContext.xml.in        |  209 ++++----
 client/tomcatconf/componentContext.xml.in          |  416 +++++----------
 client/tomcatconf/nonossComponentContext.xml.in    |   43 +-
 .../src/com/cloud/network/NetworkManagerImpl.java  |   43 ++-
 server/src/com/cloud/network/NetworkModelImpl.java |   12 +-
 .../src/com/cloud/server/ManagementServerImpl.java |    8 +
 server/src/com/cloud/user/AccountManagerImpl.java  |   12 +-
 7 files changed, 313 insertions(+), 430 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/646c4fb7/client/tomcatconf/applicationContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/applicationContext.xml.in b/client/tomcatconf/applicationContext.xml.in
index ca6b402..da7a380 100644
--- a/client/tomcatconf/applicationContext.xml.in
+++ b/client/tomcatconf/applicationContext.xml.in
@@ -35,19 +35,27 @@
   <!--
     @DB support
   -->
-  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
+  <aop:config>
+    <aop:aspect id="dbContextBuilder" ref="transactionContextBuilder">
+        <aop:pointcut id="captureAnyMethod"
+            expression="execution(* *(..))" 
+        />
+        
+        <aop:around pointcut-ref="captureAnyMethod" method="AroundAnyMethod"/> 
+    </aop:aspect>
+
+    <aop:aspect id="actionEventInterceptorAspect" ref="actionEventInterceptor">
+        <aop:pointcut id="captureEventMethod"
+            expression="execution(* *(..)) and @annotation(com.cloud.event.ActionEvent)" 
+        />
+
+        <aop:around pointcut-ref="captureEventMethod" method="AroundAnyMethod"/> 
+    </aop:aspect>
+  </aop:config>
+
   <bean id="transactionContextBuilder" class="com.cloud.utils.db.TransactionContextBuilder" />
   <bean id="actionEventInterceptor" class="com.cloud.event.ActionEventInterceptor" />
 
-  <bean id="instantiatePostProcessor" class="com.cloud.utils.component.ComponentInstantiationPostProcessor">
-    <property name="Interceptors">
-        <list>
-            <ref bean="transactionContextBuilder" />
-            <ref bean="actionEventInterceptor" />
-        </list>
-    </property>
-  </bean>
-
   <!--
     RPC/Async/EventBus
   -->
@@ -152,7 +160,7 @@
       </map>
     </property>  
   </bean>
-  
+
   <!--
     DAOs with default configuration
   -->
@@ -175,7 +183,6 @@
   <bean id="certificateDaoImpl" class="com.cloud.certificate.dao.CertificateDaoImpl" />
   <bean id="clusterDaoImpl" class="com.cloud.dc.dao.ClusterDaoImpl" />
   <bean id="clusterDetailsDaoImpl" class="com.cloud.dc.ClusterDetailsDaoImpl" />
-  <bean id="clusterVSMMapDaoImpl" class="com.cloud.dc.dao.ClusterVSMMapDaoImpl" />
   <bean id="commandExecLogDaoImpl" class="com.cloud.secstorage.CommandExecLogDaoImpl" />
   <bean id="conditionDaoImpl" class="com.cloud.network.as.dao.ConditionDaoImpl" />
   <bean id="consoleProxyDaoImpl" class="com.cloud.vm.dao.ConsoleProxyDaoImpl" />
@@ -203,14 +210,12 @@
   <bean id="externalPublicIpStatisticsDaoImpl" class="com.cloud.usage.dao.ExternalPublicIpStatisticsDaoImpl" />
   <bean id="firewallRulesCidrsDaoImpl" class="com.cloud.network.dao.FirewallRulesCidrsDaoImpl" />
   <bean id="firewallRulesDaoImpl" class="com.cloud.network.dao.FirewallRulesDaoImpl" />
-  <bean id="globalLoadBalancerDaoImpl" class="org.apache.cloudstack.region.gslb.GlobalLoadBalancerDaoImpl" />
-  <bean id="globalLoadBalancerLbRuleMapDaoImpl" class="org.apache.cloudstack.region.gslb.GlobalLoadBalancerLbRuleMapDaoImpl" />
   <bean id="guestOSCategoryDaoImpl" class="com.cloud.storage.dao.GuestOSCategoryDaoImpl" />
   <bean id="guestOSDaoImpl" class="com.cloud.storage.dao.GuestOSDaoImpl" />
   <bean id="highAvailabilityDaoImpl" class="com.cloud.ha.dao.HighAvailabilityDaoImpl" />
   <bean id="hostDaoImpl" class="com.cloud.host.dao.HostDaoImpl" />
-  <bean id="engineHostDetailsDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.HostDetailsDaoImpl" />
   <bean id="hostDetailsDaoImpl" class="com.cloud.host.dao.HostDetailsDaoImpl" />
+  <bean id="engineHostDetailsDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.HostDetailsDaoImpl" />
   <bean id="hostJoinDaoImpl" class="com.cloud.api.query.dao.HostJoinDaoImpl" />
   <bean id="engineHostTagsDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.HostTagsDaoImpl" />
   <bean id="hostTagsDaoImpl" class="com.cloud.host.dao.HostTagsDaoImpl" />
@@ -218,6 +223,7 @@
   <bean id="iPAddressDaoImpl" class="com.cloud.network.dao.IPAddressDaoImpl" />
   <bean id="identityDaoImpl" class="com.cloud.uuididentity.dao.IdentityDaoImpl" />
   <bean id="imageDaoStoreDaoImpl" class="org.apache.cloudstack.storage.image.db.ImageDaoStoreDaoImpl" />
+  <bean id="imageDataDaoImpl" class="org.apache.cloudstack.storage.image.db.ImageDataDaoImpl" />
   <bean id="imageDataStoreProviderDaoImpl" class="org.apache.cloudstack.storage.image.db.ImageDataStoreProviderDaoImpl" />
   <bean id="inlineLoadBalancerNicMapDaoImpl" class="com.cloud.network.dao.InlineLoadBalancerNicMapDaoImpl" />
   <bean id="instanceGroupDaoImpl" class="com.cloud.vm.dao.InstanceGroupDaoImpl" />
@@ -225,20 +231,12 @@
   <bean id="instanceGroupVMMapDaoImpl" class="com.cloud.vm.dao.InstanceGroupVMMapDaoImpl" />
   <bean id="itWorkDaoImpl" class="com.cloud.vm.ItWorkDaoImpl" />
   <bean id="keystoreDaoImpl" class="com.cloud.keystore.KeystoreDaoImpl" />
-  <bean id="lBHealthCheckPolicyDaoImpl" class="com.cloud.network.dao.LBHealthCheckPolicyDaoImpl" />
   <bean id="lBStickinessPolicyDaoImpl" class="com.cloud.network.dao.LBStickinessPolicyDaoImpl" />
   <bean id="launchPermissionDaoImpl" class="com.cloud.storage.dao.LaunchPermissionDaoImpl" />
   <bean id="loadBalancerDaoImpl" class="com.cloud.network.dao.LoadBalancerDaoImpl" />
   <bean id="loadBalancerVMMapDaoImpl" class="com.cloud.network.dao.LoadBalancerVMMapDaoImpl" />
   <bean id="managementServerHostDaoImpl" class="com.cloud.cluster.dao.ManagementServerHostDaoImpl" />
   <bean id="managementServerHostPeerDaoImpl" class="com.cloud.cluster.dao.ManagementServerHostPeerDaoImpl" />
-  <bean id="mockConfigurationDaoImpl" class="com.cloud.simulator.dao.MockConfigurationDaoImpl" />
-  <bean id="mockHostDaoImpl" class="com.cloud.simulator.dao.MockHostDaoImpl" />
-  <bean id="mockSecStorageDaoImpl" class="com.cloud.simulator.dao.MockSecStorageDaoImpl" />
-  <bean id="mockSecurityRulesDaoImpl" class="com.cloud.simulator.dao.MockSecurityRulesDaoImpl" />
-  <bean id="mockStoragePoolDaoImpl" class="com.cloud.simulator.dao.MockStoragePoolDaoImpl" />
-  <bean id="mockVMDaoImpl" class="com.cloud.simulator.dao.MockVMDaoImpl" />
-  <bean id="mockVolumeDaoImpl" class="com.cloud.simulator.dao.MockVolumeDaoImpl" />
   <bean id="networkAccountDaoImpl" class="com.cloud.network.dao.NetworkAccountDaoImpl" />
   <bean id="networkDaoImpl" class="com.cloud.network.dao.NetworkDaoImpl" />
   <bean id="networkDomainDaoImpl" class="com.cloud.network.dao.NetworkDomainDaoImpl" />
@@ -250,7 +248,6 @@
   <bean id="networkRuleConfigDaoImpl" class="com.cloud.network.dao.NetworkRuleConfigDaoImpl" />
   <bean id="networkServiceMapDaoImpl" class="com.cloud.network.dao.NetworkServiceMapDaoImpl" />
   <bean id="nicDaoImpl" class="com.cloud.vm.dao.NicDaoImpl" />
-  <bean id="nicSecondaryIpDaoImpl" class="com.cloud.vm.dao.NicSecondaryIpDaoImpl" />
   <bean id="objectInDataStoreDaoImpl" class="org.apache.cloudstack.storage.db.ObjectInDataStoreDaoImpl" />
   <bean id="ovsTunnelInterfaceDaoImpl" class="com.cloud.network.ovs.dao.OvsTunnelInterfaceDaoImpl" />
   <bean id="ovsTunnelNetworkDaoImpl" class="com.cloud.network.ovs.dao.OvsTunnelNetworkDaoImpl" />
@@ -262,7 +259,6 @@
   <bean id="podVlanDaoImpl" class="com.cloud.dc.dao.PodVlanDaoImpl" />
   <bean id="podVlanMapDaoImpl" class="com.cloud.dc.dao.PodVlanMapDaoImpl" />
   <bean id="portForwardingRulesDaoImpl" class="com.cloud.network.rules.dao.PortForwardingRulesDaoImpl" />
-  <bean id="portProfileDaoImpl" class="com.cloud.network.dao.PortProfileDaoImpl" />
   <bean id="primaryDataStoreDaoImpl" class="org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDaoImpl" />
   <bean id="primaryDataStoreDetailsDaoImpl" class="org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDetailsDaoImpl" />
   <bean id="privateIpDaoImpl" class="com.cloud.network.vpc.dao.PrivateIpDaoImpl" />
@@ -300,6 +296,7 @@
   <bean id="staticRouteDaoImpl" class="com.cloud.network.vpc.dao.StaticRouteDaoImpl" />
   <bean id="storageNetworkIpAddressDaoImpl" class="com.cloud.dc.dao.StorageNetworkIpAddressDaoImpl" />
   <bean id="storageNetworkIpRangeDaoImpl" class="com.cloud.dc.dao.StorageNetworkIpRangeDaoImpl" />
+  <bean id="storagePoolDaoImpl" class="com.cloud.storage.dao.StoragePoolDaoImpl" />
   <bean id="storagePoolDetailsDaoImpl" class="com.cloud.storage.dao.StoragePoolDetailsDaoImpl" />
   <bean id="storagePoolHostDaoImpl" class="com.cloud.storage.dao.StoragePoolHostDaoImpl" />
   <bean id="storagePoolJoinDaoImpl" class="com.cloud.api.query.dao.StoragePoolJoinDaoImpl" />
@@ -327,8 +324,6 @@
   <bean id="userIpv6AddressDaoImpl" class="com.cloud.network.dao.UserIpv6AddressDaoImpl" />
   <bean id="userStatisticsDaoImpl" class="com.cloud.user.dao.UserStatisticsDaoImpl" />
   <bean id="userStatsLogDaoImpl" class="com.cloud.user.dao.UserStatsLogDaoImpl" />
-  <bean id="userVmCloneSettingDaoImpl" class="com.cloud.vm.dao.UserVmCloneSettingDaoImpl" />
-  <bean id="userVmDaoImpl" class="com.cloud.vm.dao.UserVmDaoImpl" />
   <bean id="userVmDetailsDaoImpl" class="com.cloud.vm.dao.UserVmDetailsDaoImpl" />
   <bean id="userVmJoinDaoImpl" class="com.cloud.api.query.dao.UserVmJoinDaoImpl" />
   <bean id="vMComputeTagDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMComputeTagDaoImpl" />
@@ -337,7 +332,6 @@
   <bean id="vMNetworkMapDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMNetworkMapDaoImpl" />
   <bean id="vMReservationDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMReservationDaoImpl" />
   <bean id="vMRootDiskTagDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMRootDiskTagDaoImpl" />
-  <bean id="vMSnapshotDaoImpl" class="com.cloud.vm.snapshot.dao.VMSnapshotDaoImpl" />
   <bean id="vMTemplateDetailsDaoImpl" class="com.cloud.storage.dao.VMTemplateDetailsDaoImpl" />
   <bean id="vMTemplateHostDaoImpl" class="com.cloud.storage.dao.VMTemplateHostDaoImpl" />
   <bean id="vMTemplatePoolDaoImpl" class="com.cloud.storage.dao.VMTemplatePoolDaoImpl" />
@@ -356,8 +350,10 @@
   <bean id="vpcGatewayDaoImpl" class="com.cloud.network.vpc.dao.VpcGatewayDaoImpl" />
   <bean id="vpcOfferingDaoImpl" class="com.cloud.network.vpc.dao.VpcOfferingDaoImpl" />
   <bean id="vpcOfferingServiceMapDaoImpl" class="com.cloud.network.vpc.dao.VpcOfferingServiceMapDaoImpl" />
-  <bean id="vpcServiceMapDaoImpl" class="com.cloud.network.vpc.dao.VpcServiceMapDaoImpl" />
   <bean id="vpnUserDaoImpl" class="com.cloud.network.dao.VpnUserDaoImpl" />
+  <bean id="userVmDaoImpl" class="com.cloud.vm.dao.UserVmDaoImpl" />
+  <bean id="portProfileDaoImpl" class="com.cloud.network.dao.PortProfileDaoImpl" />
+  <bean id="clusterVSMMapDaoImpl" class="com.cloud.dc.dao.ClusterVSMMapDaoImpl" />
 
   <!--
     Checkers
@@ -366,10 +362,10 @@
   <bean id="StaticRoleBasedAPIAccessChecker" class="org.apache.cloudstack.acl.StaticRoleBasedAPIAccessChecker"/>
   <bean id="databaseIntegrityChecker" class="com.cloud.upgrade.DatabaseIntegrityChecker" />
   <bean id="domainChecker" class="com.cloud.acl.DomainChecker" />
-  
+
   <!--
     Authenticators
-  --> 
+  -->
   <bean id="basicAgentAuthManager" class="com.cloud.agent.manager.authn.impl.BasicAgentAuthManager">
     <property name="name" value="BASIC"/>
   </bean>
@@ -386,6 +382,15 @@
   <bean id="Ovs" class="com.cloud.network.element.OvsElement">
     <property name="name" value="Ovs"/>
   </bean>
+  <bean id="BareMetalDhcp" class="com.cloud.baremetal.networkservice.BaremetalDhcpElement">
+    <property name="name" value="BareMetalDhcp"/>
+  </bean>
+  <bean id="BareMetalPxe" class="com.cloud.baremetal.networkservice.BaremetalPxeElement">
+    <property name="name" value="BareMetalPxe"/>
+  </bean>
+  <bean id="BareMetalUserdata" class="com.cloud.baremetal.networkservice.BaremetalUserdataElement">
+      <property name="name" value="BareMetalUserdata"/>
+  </bean>
   <bean id="SecurityGroupProvider" class="com.cloud.network.element.SecurityGroupElement">
     <property name="name" value="SecurityGroupProvider"/>
   </bean>
@@ -400,9 +405,9 @@
     <property name="name" value="ElasticLoadBalancerElement"/>
   </bean>
 
-  <!-- 
+  <!--
     General allocators
-  -->             
+  -->
   <bean id="firstFitAllocator" class="com.cloud.agent.manager.allocator.impl.FirstFitAllocator" />
   <bean id="randomAllocator" class="com.cloud.agent.manager.allocator.impl.RandomAllocator" />
 
@@ -412,29 +417,33 @@
   <bean id="FirstFitRouting" class="com.cloud.agent.manager.allocator.impl.FirstFitRoutingAllocator">
     <property name="name" value="FirstFitRouting"/>
   </bean>
-  
+
   <!--
     Storage pool allocators
   -->
-  <bean id="LocalStoragePoolAllocator" class="org.apache.cloudstack.storage.allocator.LocalStoragePoolAllocator">
+  <bean id="LocalStoragePoolAllocator" class="com.cloud.storage.allocator.LocalStoragePoolAllocator">
     <property name="name" value="LocalStorage"/>
   </bean>
-  <bean id="clusterScopeStoragePoolAllocator" class="org.apache.cloudstack.storage.allocator.ClusterScopeStoragePoolAllocator" />
-  <bean id="zoneWideStoragePoolAllocator" class="org.apache.cloudstack.storage.allocator.ZoneWideStoragePoolAllocator" />
-  <bean id="garbageCollectingStoragePoolAllocator" class="org.apache.cloudstack.storage.allocator.GarbageCollectingStoragePoolAllocator">
-    <property name="name" value="GCStorage"/>
+  <bean id="FirstFitStoragePoolAllocator" class="com.cloud.storage.allocator.FirstFitStoragePoolAllocator">
+    <property name="name" value="Storage"/>
   </bean>
 
   <bean id="UserConcentratedAllocator" class="com.cloud.agent.manager.allocator.impl.UserConcentratedAllocator">
     <property name="name" value="UserFirst"/>
   </bean>
-  
-  
+
+  <bean id="useLocalForRootAllocator" class="com.cloud.storage.allocator.UseLocalForRootAllocator">
+    <property name="name" value="LocalForRoot"/>
+  </bean>
+
+  <bean id="garbageCollectingStoragePoolAllocator" class="com.cloud.storage.allocator.GarbageCollectingStoragePoolAllocator">
+    <property name="name" value="GCStorage"/>
+  </bean>
+  <bean id="randomStoragePoolAllocator" class="com.cloud.storage.allocator.RandomStoragePoolAllocator" />
   <bean id="recreatableFencer" class="com.cloud.ha.RecreatableFencer" />
   <bean id="recreateHostAllocator" class="com.cloud.agent.manager.allocator.impl.RecreateHostAllocator" />
   <bean id="secondaryStorageVmDefaultAllocator" class="com.cloud.storage.secondary.SecondaryStorageVmDefaultAllocator" />
 
-
   <!--
     Misc allocator & Adapters
   -->
@@ -446,7 +455,8 @@
     <property name="name" value="Basic"/>
   </bean>
 
-  <bean id="hyervisorTemplateAdapter" class="com.cloud.template.HypervisorTemplateAdapter" />
+  <bean id="BareMetalTemplateAdapter" class="com.cloud.baremetal.manager.BareMetalTemplateAdapter" />
+  <bean id="hyervisorTemplateAdapter" class="com.cloud.template.HyervisorTemplateAdapter" />
   <bean id="clusterAlertAdapter" class="com.cloud.alert.ClusterAlertAdapter" />
   <bean id="consoleProxyAlertAdapter" class="com.cloud.alert.ConsoleProxyAlertAdapter" />
   <bean id="secondaryStorageVmAlertAdapter" class="com.cloud.alert.SecondaryStorageVmAlertAdapter" />
@@ -462,7 +472,7 @@
   <bean id="XenServerInvestigator" class="com.cloud.ha.XenServerInvestigator">
     <property name="name" value="XenServerInvestigator"/>
   </bean>
-  
+
   <bean id="UserVmDomRInvestigator" class="com.cloud.ha.UserVmDomRInvestigator">
     <property name="name" value="PingInvestigator"/>
   </bean>
@@ -499,6 +509,10 @@
     <property name="name" value="KVM Agent"/>
   </bean>
 
+  <bean id="BareMetalDiscoverer" class="com.cloud.baremetal.manager.BareMetalDiscoverer">
+    <property name="name" value="Bare Metal Agent"/>
+  </bean>
+
   <bean id="HypervServerDiscoverer" class="com.cloud.hypervisor.hyperv.HypervServerDiscoverer">
     <property name="name" value="SCVMMServer"/>
   </bean>
@@ -506,7 +520,7 @@
   <bean id="OvmDiscoverer" class="com.cloud.ovm.hypervisor.OvmDiscoverer">
     <property name="name" value="Ovm Discover"/>
   </bean>
-  
+
   <bean id="dummyHostDiscoverer" class="com.cloud.resource.DummyHostDiscoverer">
     <property name="name" value="dummyHostDiscoverer" />
   </bean>
@@ -517,11 +531,15 @@
   <bean id="UserDispersingPlanner" class="com.cloud.deploy.UserDispersingPlanner">
     <property name="name" value="UserDispersing"/>
   </bean>
-  
+
   <bean id="UserConcentratedPodPlanner" class="com.cloud.deploy.UserConcentratedPodPlanner">
     <property name="name" value="UserConcentratedPod"/>
   </bean>
 
+  <bean id="BareMetalPlanner" class="com.cloud.baremetal.manager.BareMetalPlanner">
+    <property name="name" value="BareMetal Fit"/>
+  </bean>
+
   <bean id="clusterBasedAgentLoadBalancerPlanner" class="com.cloud.cluster.agentlb.ClusterBasedAgentLoadBalancerPlanner">
     <property name="name" value="ClusterBasedAgentLoadBalancerPlanner"/>
   </bean>
@@ -563,7 +581,7 @@
   <bean id="XenServerGuru" class="com.cloud.hypervisor.XenServerGuru">
     <property name="name" value="XenServerGuru"/>
   </bean>
-  
+
   <bean id="KVMGuru" class="com.cloud.hypervisor.KVMGuru">
     <property name="name" value="KVMGuru"/>
   </bean>
@@ -571,16 +589,24 @@
   <bean id="OvmGuru" class="com.cloud.ovm.hypervisor.OvmGuru">
     <property name="name" value="OvmGuru"/>
   </bean>
-  
+
+  <bean id="BaremetalGuru" class="com.cloud.baremetal.manager.BareMetalGuru">
+    <property name="name" value="BaremetalGuru"/>
+  </bean>
+
+  <bean id="BaremetalPlannerSelector" class="com.cloud.baremetal.manager.BaremetalPlannerSelector">
+    <property name="name" value="BaremetalPlannerSelector"/>
+  </bean>
+
   <bean id="HypervisorPlannerSelector" class="com.cloud.deploy.HypervisorVmPlannerSelector">
     <property name="name" value="HypervisorPlannerSelector"/>
   </bean>
 
   <!--
     Managers
-  --> 
+  -->
   <bean id="configurationServerImpl" class="com.cloud.server.ConfigurationServerImpl" />
-   
+
   <bean id="clusterManagerImpl" class="com.cloud.cluster.ClusterManagerImpl" />
   <bean id="clusteredAgentManagerImpl" class="com.cloud.agent.manager.ClusteredAgentManagerImpl" />
 
@@ -593,6 +619,12 @@
 
   <bean id="apiRateLimitServiceImpl" class="org.apache.cloudstack.ratelimit.ApiRateLimitServiceImpl"/>
 
+  <bean id="BaremetalManager" class="com.cloud.baremetal.manager.BaremetalManagerImpl"/>
+  <bean id="BaremetalDhcpManager" class="com.cloud.baremetal.networkservice.BaremetalDhcpManagerImpl"/>
+  <bean id="BaremetalKickStartPxeService" class="com.cloud.baremetal.networkservice.BaremetalKickStartServiceImpl"/>
+  <bean id="BaremetalPingPxeService" class="com.cloud.baremetal.networkservice.BareMetalPingServiceImpl" />
+  <bean id="BaremetalPxeManager" class="com.cloud.baremetal.networkservice.BaremetalPxeManagerImpl" />
+
   <bean id="alertManagerImpl" class="com.cloud.alert.AlertManagerImpl" />
   <bean id="asyncJobExecutorContextImpl" class="com.cloud.async.AsyncJobExecutorContextImpl" />
   <bean id="asyncJobManagerImpl" class="com.cloud.async.AsyncJobManagerImpl" />
@@ -601,6 +633,8 @@
   <bean id="clusterFenceManagerImpl" class="com.cloud.cluster.ClusterFenceManagerImpl" />
   <bean id="configurationManagerImpl" class="com.cloud.configuration.ConfigurationManagerImpl" />
   <bean id="dataStoreProviderManagerImpl" class="org.apache.cloudstack.storage.datastore.provider.DataStoreProviderManagerImpl" />
+  <bean id="domainManagerImpl" class="com.cloud.user.DomainManagerImpl" />
+  <bean id="downloadMonitorImpl" class="com.cloud.storage.download.DownloadMonitorImpl" />
   <bean id="elasticLoadBalancerManagerImpl" class="com.cloud.network.lb.ElasticLoadBalancerManagerImpl" />
   <bean id="entityManagerImpl" class="com.cloud.dao.EntityManagerImpl" />
   <bean id="externalLoadBalancerUsageManagerImpl" class="com.cloud.network.ExternalLoadBalancerUsageManagerImpl" />
@@ -639,57 +673,13 @@
   <bean id="vpcVirtualNetworkApplianceManagerImpl" class="com.cloud.network.router.VpcVirtualNetworkApplianceManagerImpl" />
 
   <!--
-    Baremetal components
-  -->
-<!--
-  <bean id="BareMetalDhcp" class="com.cloud.baremetal.networkservice.BaremetalDhcpElement">
-    <property name="name" value="BareMetalDhcp"/>
-  </bean>
-  <bean id="BareMetalPxe" class="com.cloud.baremetal.networkservice.BaremetalPxeElement">
-    <property name="name" value="BareMetalPxe"/>
-  </bean>
-  <bean id="BareMetalUserdata" class="com.cloud.baremetal.networkservice.BaremetalUserdataElement">
-      <property name="name" value="BareMetalUserdata"/>
-  </bean>
-
-  <bean id="BareMetalTemplateAdapter" class="com.cloud.baremetal.manager.BareMetalTemplateAdapter" />
-
-  <bean id="BareMetalDiscoverer" class="com.cloud.baremetal.manager.BareMetalDiscoverer">
-    <property name="name" value="Bare Metal Agent"/>
-  </bean>
-
-  <bean id="BareMetalPlanner" class="com.cloud.baremetal.manager.BareMetalPlanner">
-    <property name="name" value="BareMetal Fit"/>
-  </bean>
-  
-  <bean id="BaremetalGuru" class="com.cloud.baremetal.manager.BareMetalGuru">
-    <property name="name" value="BaremetalGuru"/>
-  </bean>
-
-  <bean id="BaremetalPlannerSelector" class="com.cloud.baremetal.manager.BaremetalPlannerSelector">
-    <property name="name" value="BaremetalPlannerSelector"/>
-  </bean>
-
-  <bean id="BaremetalManager" class="com.cloud.baremetal.manager.BaremetalManagerImpl"/>
-  <bean id="BaremetalDhcpManager" class="com.cloud.baremetal.networkservice.BaremetalDhcpManagerImpl"/>
-  <bean id="BaremetalKickStartPxeService" class="com.cloud.baremetal.networkservice.BaremetalKickStartServiceImpl"/>
-  <bean id="BaremetalPingPxeService" class="com.cloud.baremetal.networkservice.BareMetalPingServiceImpl" />
-  <bean id="BaremetalPxeManager" class="com.cloud.baremetal.networkservice.BaremetalPxeManagerImpl" /> 
-    
-  <bean id="bAREMETAL" class="org.apache.cloudstack.storage.image.format.BAREMETAL" />
-  <bean id="baremetalDhcpDaoImpl" class="com.cloud.baremetal.database.BaremetalDhcpDaoImpl" />
-  <bean id="baremetalPxeDaoImpl" class="com.cloud.baremetal.database.BaremetalPxeDaoImpl" />
--->
-
-  <!--
     Misc components
   -->
+  <bean id="cloudZonesStartupProcessor" class="com.cloud.hypervisor.CloudZonesStartupProcessor" />
+  <bean id="managementServerNode" class="com.cloud.cluster.ManagementServerNode" />
   <bean id="actionEventUtils" class="com.cloud.event.ActionEventUtils" />
   <bean id="agentMonitor" class="com.cloud.agent.manager.AgentMonitor" />
   <bean id="alertGenerator" class="com.cloud.event.AlertGenerator" />
-  <bean id="ancientDataMotionStrategy" class="org.apache.cloudstack.storage.motion.AncientDataMotionStrategy" />
-  <bean id="ancientImageDataStoreProvider" class="org.apache.cloudstack.storage.image.store.AncientImageDataStoreProvider" />
-  <bean id="ancientSnapshotStrategy" class="org.apache.cloudstack.storage.snapshot.strategy.AncientSnapshotStrategy" />
   <bean id="apiDBUtils" class="com.cloud.api.ApiDBUtils" />
   <bean id="apiDiscoveryServiceImpl" class="org.apache.cloudstack.discovery.ApiDiscoveryServiceImpl" />
   <bean id="apiDispatcher" class="com.cloud.api.ApiDispatcher" />
@@ -699,6 +689,7 @@
   <bean id="bAREMETAL" class="org.apache.cloudstack.storage.image.format.BAREMETAL" />
   <bean id="cloudOrchestrator" class="org.apache.cloudstack.platform.orchestration.CloudOrchestrator" />
   <bean id="clusterRestService" class="org.apache.cloudstack.engine.rest.service.api.ClusterRestService" />
+  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
   <bean id="consoleProxyServlet" class="com.cloud.servlet.ConsoleProxyServlet" />
   <bean id="dataCenterResourceManagerImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceManagerImpl" />
   <bean id="dataDisk" class="org.apache.cloudstack.engine.subsystem.api.storage.type.DataDisk" />
@@ -706,9 +697,12 @@
   <bean id="dataObjectManagerImpl" class="org.apache.cloudstack.storage.datastore.DataObjectManagerImpl" />
   <bean id="dataStoreManagerImpl" class="org.apache.cloudstack.storage.datastore.DataStoreManagerImpl" />
   <bean id="defaultEndPointSelector" class="org.apache.cloudstack.storage.endpoint.DefaultEndPointSelector" />
+  <bean id="defaultImageDataStoreProvider" class="org.apache.cloudstack.storage.image.store.DefaultImageDataStoreProvider" />
+  <bean id="defaultImageMotionStrategy" class="org.apache.cloudstack.storage.image.motion.DefaultImageMotionStrategy" />
   <bean id="defaultPrimaryDataStoreProviderManagerImpl" class="org.apache.cloudstack.storage.datastore.manager.DefaultPrimaryDataStoreProviderManagerImpl" />
+  <bean id="defaultPrimaryDatastoreProviderImpl" class="org.apache.cloudstack.storage.datastore.provider.DefaultPrimaryDatastoreProviderImpl" />
   <bean id="eventUtils" class="com.cloud.event.EventUtils" />
-  <bean id="globalLoadBalancingRulesServiceImpl" class="org.apache.cloudstack.region.gslb.GlobalLoadBalancingRulesServiceImpl" />
+  <bean id="hypervisorBasedSnapshot" class="org.apache.cloudstack.storage.snapshot.strategy.HypervisorBasedSnapshot" />
   <bean id="hypervsiorHostEndPointRpcServer" class="org.apache.cloudstack.storage.HypervsiorHostEndPointRpcServer" />
   <bean id="iSCSI" class="org.apache.cloudstack.storage.datastore.type.ISCSI" />
   <bean id="iSO" class="org.apache.cloudstack.storage.image.format.ISO" />
@@ -717,6 +711,7 @@
   <bean id="imageDataStoreHelper" class="org.apache.cloudstack.storage.image.datastore.ImageDataStoreHelper" />
   <bean id="imageDataStoreManagerImpl" class="org.apache.cloudstack.storage.image.manager.ImageDataStoreManagerImpl" />
   <bean id="imageFormatHelper" class="org.apache.cloudstack.storage.image.format.ImageFormatHelper" />
+  <bean id="imageMotionServiceImpl" class="org.apache.cloudstack.storage.image.motion.ImageMotionServiceImpl" />
   <bean id="imageServiceImpl" class="org.apache.cloudstack.storage.image.ImageServiceImpl" />
   <bean id="iso" class="org.apache.cloudstack.engine.subsystem.api.storage.type.Iso" />
   <bean id="networkFileSystem" class="org.apache.cloudstack.storage.datastore.type.NetworkFileSystem" />
@@ -731,36 +726,20 @@
   <bean id="rootDisk" class="org.apache.cloudstack.engine.subsystem.api.storage.type.RootDisk" />
   <bean id="snapshotDataFactoryImpl" class="org.apache.cloudstack.storage.snapshot.SnapshotDataFactoryImpl" />
   <bean id="snapshotServiceImpl" class="org.apache.cloudstack.storage.snapshot.SnapshotServiceImpl" />
-  <bean id="snapshotStateMachineManagerImpl" class="org.apache.cloudstack.storage.snapshot.SnapshotStateMachineManagerImpl" />
   <bean id="statsCollector" class="com.cloud.server.StatsCollector" />
-  <bean id="storagePoolAutomationImpl" class="com.cloud.storage.StoragePoolAutomationImpl" />
   <bean id="templateInstallStrategyImpl" class="org.apache.cloudstack.storage.volume.TemplateInstallStrategyImpl" />
   <bean id="unknown" class="org.apache.cloudstack.storage.image.format.Unknown" />
   <bean id="usageEventUtils" class="com.cloud.event.UsageEventUtils" />
   <bean id="userContextInitializer" class="com.cloud.user.UserContextInitializer" />
   <bean id="vHD" class="org.apache.cloudstack.storage.image.format.VHD" />
   <bean id="vMEntityManagerImpl" class="org.apache.cloudstack.engine.cloud.entity.api.VMEntityManagerImpl" />
-  <bean id="virtualMachineEntityFactory" class="org.apache.cloudstack.engine.cloud.entity.api.VirtualMachineEntityFactory" />
   <bean id="virtualMachineEntityImpl" class="org.apache.cloudstack.engine.cloud.entity.api.VirtualMachineEntityImpl" />
   <bean id="virtualMachineRestService" class="org.apache.cloudstack.engine.rest.service.api.VirtualMachineRestService" />
   <bean id="volumeDataFactoryImpl" class="org.apache.cloudstack.storage.volume.VolumeDataFactoryImpl" />
+  <bean id="volumeManagerImpl" class="org.apache.cloudstack.storage.volume.VolumeManagerImpl" />
   <bean id="volumeRestService" class="org.apache.cloudstack.engine.rest.service.api.VolumeRestService" />
   <bean id="volumeServiceImpl" class="org.apache.cloudstack.storage.volume.VolumeServiceImpl" />
   <bean id="volumeTypeHelper" class="org.apache.cloudstack.engine.subsystem.api.storage.type.VolumeTypeHelper" />
   <bean id="zoneRestService" class="org.apache.cloudstack.engine.rest.service.api.ZoneRestService" />
-  <bean id="cloudZonesStartupProcessor" class="com.cloud.hypervisor.CloudZonesStartupProcessor" />
-  <bean id="managementServerNode" class="com.cloud.cluster.ManagementServerNode" />
-  <bean id="testingAllocator" class="com.cloud.agent.manager.allocator.impl.TestingAllocator" />
-  <bean id="domainManagerImpl" class="com.cloud.user.DomainManagerImpl" />
-  <bean id="downloadMonitorImpl" class="com.cloud.storage.download.DownloadMonitorImpl" />
-  <bean id="lBHealthCheckManagerImpl" class="com.cloud.network.lb.LBHealthCheckManagerImpl" />
-  <bean id="mockAgentManagerImpl" class="com.cloud.agent.manager.MockAgentManagerImpl" />
-  <bean id="mockStorageManagerImpl" class="com.cloud.agent.manager.MockStorageManagerImpl" />
-  <bean id="mockVmManagerImpl" class="com.cloud.agent.manager.MockVmManagerImpl" />
-  <bean id="resourceManagerImpl" class="com.cloud.resource.ResourceManagerImpl" />
-  <bean id="simulatorManagerImpl" class="com.cloud.agent.manager.SimulatorManagerImpl" />
-  <bean id="vMSnapshotManagerImpl" class="com.cloud.vm.snapshot.VMSnapshotManagerImpl" />
-  <bean id="volumeManagerImpl" class="com.cloud.storage.VolumeManagerImpl" />
-  <bean id="ClassicalPrimaryDataStoreProvider" class="org.apache.cloudstack.storage.datastore.provider.CloudStackPrimaryDataStoreProviderImpl" />
-  
+
 </beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/646c4fb7/client/tomcatconf/componentContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/componentContext.xml.in b/client/tomcatconf/componentContext.xml.in
index dad5d4d..927dc51 100644
--- a/client/tomcatconf/componentContext.xml.in
+++ b/client/tomcatconf/componentContext.xml.in
@@ -28,304 +28,176 @@
                       http://www.springframework.org/schema/aop
                       http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
                       http://www.springframework.org/schema/context
-                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">                     
-
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
 
   <!--
-      Compose a CloudStack deployment with selected components here
+    OSS deployment component configuration
   -->
+
   <bean id="databaseUpgradeChecker" class="com.cloud.upgrade.DatabaseUpgradeChecker" />
-  <bean id="encryptionSecretKeyChecker" class="com.cloud.utils.crypt.EncryptionSecretKeyChecker" />
-  <bean id="configurationServerImpl" class="com.cloud.server.ConfigurationServerImpl" />
+  <bean id="configurationDaoImpl" class="com.cloud.configuration.dao.ConfigurationDaoImpl" />
 
-  <bean id="managementServerImpl" class ="com.cloud.server.ManagementServerImpl" >
+  <!--
+    Managers & pluggable adapters configuration under OSS deployment
+  -->
+  <bean id="accountManagerImpl" class="com.cloud.user.AccountManagerImpl" >
     <property name="UserAuthenticators">
-        <list>
-            <ref bean="MD5UserAuthenticator"/>
-            <ref bean="LDAPUserAuthenticator"/>
-        </list>
+      <list>
+          <ref bean="MD5UserAuthenticator"/>
+          <ref bean="LDAPUserAuthenticator"/>
+      </list>
+    </property>
+    <property name="SecurityCheckers">
+      <list>
+          <ref bean="domainChecker"/>
+      </list>
     </property>
   </bean>
 
-  <bean id ="AccountManagerImpl" class="com.cloud.user.AccountManagerImpl">
+  <bean id="managementServerImpl" class ="com.cloud.server.ManagementServerImpl">
     <property name="UserAuthenticators">
-        <list>
-            <ref bean="MD5UserAuthenticator"/>
-            <ref bean="LDAPUserAuthenticator"/>
-        </list>
+      <list>
+          <ref bean="MD5UserAuthenticator"/>
+          <ref bean="LDAPUserAuthenticator"/>
+      </list>
+    </property>
+    <property name="HostAllocators">
+      <list>
+          <ref bean="FirstFitRouting"/>
+      </list>
     </property>
-  </bean>
-   
-  <bean id="clusterManagerImpl" class="com.cloud.cluster.ClusterManagerImpl" />
-  <bean id="clusteredAgentManagerImpl" class="com.cloud.agent.manager.ClusteredAgentManagerImpl" />
-  <bean id="clusteredVirtualMachineManagerImpl" class="com.cloud.vm.ClusteredVirtualMachineManagerImpl" />
-  <bean id="highAvailabilityManagerExtImpl" class="com.cloud.ha.HighAvailabilityManagerExtImpl" />
-  <bean id="userVmManagerImpl" class="com.cloud.vm.UserVmManagerImpl" />
-  <bean id="consoleProxyManagerImpl" class="com.cloud.consoleproxy.ConsoleProxyManagerImpl" />
-  <bean id="securityGroupManagerImpl2" class="com.cloud.network.security.SecurityGroupManagerImpl2" />
-  <bean id="premiumSecondaryStorageManagerImpl" class="com.cloud.secstorage.PremiumSecondaryStorageManagerImpl" />
-  <bean id="userVmDaoImpl" class="com.cloud.vm.dao.UserVmDaoImpl" />
-  <bean id="ipv6AddressManagerImpl" class="com.cloud.network.Ipv6AddressManagerImpl" />
-
-  <bean id="apiRateLimitServiceImpl" class="org.apache.cloudstack.ratelimit.ApiRateLimitServiceImpl"/>
-  <bean id="BaremetalManager" class="com.cloud.baremetal.manager.BaremetalManagerImpl"/>
-  <bean id="BaremetalDhcpManager" class="com.cloud.baremetal.networkservice.BaremetalDhcpManagerImpl"/>
-  <bean id="BaremetalKickStartPxeService" class="com.cloud.baremetal.networkservice.BaremetalKickStartServiceImpl"/>
-  <bean id="BaremetalPingPxeService" class="com.cloud.baremetal.networkservice.BareMetalPingServiceImpl" />
-  <bean id="BaremetalPxeManager" class="com.cloud.baremetal.networkservice.BaremetalPxeManagerImpl" />
-  <bean id="UcsManager" class="com.cloud.ucs.manager.UcsManagerImpl" />
-  <bean id="UcsBladeDao" class="com.cloud.ucs.database.UcsBladeDaoImpl" />
-  <bean id="UcsManagerDao" class="com.cloud.ucs.database.UcsManagerDaoImpl" />
-
-   
-  <!--
-      Network Elements
-  -->
-  <bean id="Ovs" class="com.cloud.network.element.OvsElement">
-    <property name="name" value="Ovs"/>
-  </bean>
-  <bean id="BareMetalDhcp" class="com.cloud.baremetal.networkservice.BaremetalDhcpElement">
-      <property name="name" value="BareMetalDhcp"/>
-  </bean>
-  <bean id="BareMetalPxe" class="com.cloud.baremetal.networkservice.BaremetalPxeElement">
-      <property name="name" value="BareMetalPxe"/>
-  </bean>
-  <bean id="BareMetalUserdata" class="com.cloud.baremetal.networkservice.BaremetalUserdataElement">
-      <property name="name" value="BareMetalUserdata"/>
-  </bean>
-  <bean id="SecurityGroupProvider" class="com.cloud.network.element.SecurityGroupElement">
-    <property name="name" value="SecurityGroupProvider"/>
-  </bean>
-  <bean id="VirtualRouter" class="com.cloud.network.element.VirtualRouterElement">
-    <property name="name" value="VirtualRouter"/>
-  </bean>
-  <bean id="VpcVirtualRouter" class="com.cloud.network.element.VpcVirtualRouterElement">
-    <property name="name" value="VpcVirtualRouter"/>
-  </bean>
-  <!--
-  <bean id="NiciraNvp" class="com.cloud.network.element.NiciraNvpElement">
-    <property name="name" value="NiciraNvp"/>
-  </bean>
-  -->
-  
-<!--
-  <bean id="BigSwitchVnsElementService" class="com.cloud.network.element.BigSwitchVnsElement">
-    <property name="name" value="BigSwitchVnsElementService"/>
-  </bean>
--->
-                   
-  <!--
-     Adapters
-  -->
-  <bean id="FirstFitRouting" class="com.cloud.agent.manager.allocator.impl.FirstFitRoutingAllocator">
-    <property name="name" value="FirstFitRouting"/>
-  </bean>
-  
-  <bean id="hypervisorTemplateAdapter" class="com.cloud.template.HypervisorTemplateAdapter">
-    <property name="name" value="HypervisorAdapter"/>
-  </bean> 
-  
-   <bean id="bareMetalTemplateAdapter" class="com.cloud.baremetal.BareMetalTemplateAdapter">
-    <property name="name" value="BareMetalAdapter"/>
-  </bean> 
-  
-  <!--
-    Storage pool allocators
-  -->
-
-  <bean id="LocalStoragePoolAllocator" class="org.apache.cloudstack.storage.allocator.LocalStoragePoolAllocator">
-    <property name="name" value="LocalStorage"/>
-  </bean>
-  <!--
-  <bean id="FirstFitStoragePoolAllocator" class="org.apache.cloudstack.storage.allocator.FirstFitStoragePoolAllocator">
-    <property name="name" value="Storage"/>
-  </bean>
-  -->
-
-  <bean id="UserConcentratedAllocator" class="com.cloud.agent.manager.allocator.impl.UserConcentratedAllocator">
-    <property name="name" value="User First"/>
-  </bean>
-
-  <bean id="ConsoleProxyAllocator" class="com.cloud.consoleproxy.ConsoleProxyBalanceAllocator">
-    <property name="name" value="Balance"/>
-  </bean>
-
-  <bean id="StaticRoleBasedAPIAccessChecker" class="org.apache.cloudstack.acl.StaticRoleBasedAPIAccessChecker"/>
-
-  <bean id="ExteralIpAddressAllocator" class="com.cloud.network.ExteralIpAddressAllocator">
-    <property name="name" value="Basic"/>
-  </bean>
-
-  <bean id="HypervisorTemplateAdapter" class="com.cloud.template.HypervisorTemplateAdapter">
-    <property name="name" value="HypervisorAdapter"/>
-  </bean>
-
-  <bean id="BareMetalTemplateAdapter" class="com.cloud.baremetal.manager.BareMetalTemplateAdapter" >
-    <property name="name" value="BareMetalTemplateAdapter"/>
-  </bean>
-
-  <!--
-    Authenticators
-  -->
-  <bean id="MD5UserAuthenticator" class="com.cloud.server.auth.MD5UserAuthenticator">
-    <property name="name" value="MD5"/>
-  </bean>
-
-  <bean id="LDAPUserAuthenticator" class="com.cloud.server.auth.LDAPUserAuthenticator">
-    <property name="name" value="LDAP"/>
-  </bean>
-
-  <!--
-    Investigators
-  -->
-  <bean id="CheckOnAgentInvestigator" class="com.cloud.ha.CheckOnAgentInvestigator">
-    <property name="name" value="SimpleInvestigator"/>
-  </bean>
-
-  <bean id="XenServerInvestigator" class="com.cloud.ha.XenServerInvestigator">
-    <property name="name" value="XenServerInvestigator"/>
-  </bean>
-  
-  <bean id="UserVmDomRInvestigator" class="com.cloud.ha.UserVmDomRInvestigator">
-    <property name="name" value="PingInvestigator"/>
-  </bean>
-
-  <bean id="ManagementIPSystemVMInvestigator" class="com.cloud.ha.ManagementIPSystemVMInvestigator">
-    <property name="name" value="ManagementIPSysVMInvestigator"/>
-  </bean>
-
-  <!--
-    Fencers
-  -->
-  <bean id="XenServerFencer" class="com.cloud.ha.XenServerFencer">
-    <property name="name" value="XenServerFenceBuilder"/>
-  </bean>
-  <bean id="KVMFencer" class="com.cloud.ha.KVMFencer">
-    <property name="name" value="KVMFenceBuilder"/>
-  </bean>
-  <bean id="OvmFencer" class="com.cloud.ovm.hypervisor.OvmFencer">
-    <property name="name" value="OvmFenceBuilder"/>
-  </bean>
-
-  <bean id="XcpServerDiscoverer" class="com.cloud.hypervisor.xen.discoverer.XcpServerDiscoverer">
-    <property name="name" value="XCP Agent"/>
-  </bean>
-
-  <bean id="SecondaryStorageDiscoverer" class="com.cloud.storage.secondary.SecondaryStorageDiscoverer">
-    <property name="name" value="SecondaryStorage"/>
-  </bean>
-
-  <bean id="KvmServerDiscoverer" class="com.cloud.hypervisor.kvm.discoverer.KvmServerDiscoverer">
-    <property name="name" value="KVM Agent"/>
-  </bean>
-
-  <bean id="SimulatorDiscoverer" class="com.cloud.resource.SimulatorDiscoverer">
-    <property name="name" value="Simulator Agent"/>
-  </bean>
-
-
-  <bean id="BareMetalDiscoverer" class="com.cloud.baremetal.manager.BareMetalDiscoverer">
-    <property name="name" value="Bare Metal Agent"/>
-  </bean>
-
-  <bean id="HypervServerDiscoverer" class="com.cloud.hypervisor.hyperv.HypervServerDiscoverer">
-    <property name="name" value="SCVMMServer"/>
   </bean>
 
-  <bean id="OvmDiscoverer" class="com.cloud.ovm.hypervisor.OvmDiscoverer">
-    <property name="name" value="Ovm Discover"/>
+  <bean id="storageManagerImpl" class="com.cloud.storage.StorageManagerImpl">
+    <property name="StoragePoolAllocators">
+      <list>
+          <ref bean="LocalStoragePoolAllocator"/>
+          <ref bean="FirstFitStoragePoolAllocator"/>
+      </list>
+    </property>
   </bean>
 
   <bean id="FirstFitPlanner" class="com.cloud.deploy.FirstFitPlanner">
     <property name="name" value="First Fit"/>
+    <property name="StoragePoolAllocators">
+      <list>
+          <ref bean="LocalStoragePoolAllocator"/>
+          <ref bean="FirstFitStoragePoolAllocator"/>
+      </list>
+    </property>
+    <property name="HostAllocators">
+      <list>
+          <ref bean="FirstFitRouting"/>
+      </list>
+    </property>
   </bean>
 
-  <bean id="UserDispersingPlanner" class="com.cloud.deploy.UserDispersingPlanner">
-    <property name="name" value="UserDispersing"/>
-  </bean>
-  
-  <bean id="UserConcentratedPodPlanner" class="com.cloud.deploy.UserConcentratedPodPlanner">
-    <property name="name" value="UserConcentratedPod"/>
+  <bean id="resourceManagerImpl" class="com.cloud.resource.ResourceManagerImpl" >
+    <property name="PodAllocators">
+      <list>
+          <ref bean="UserConcentratedAllocator"/>
+      </list>
+    </property>
+    <property name="Discoverers">
+      <list>
+          <ref bean="XcpServerDiscoverer"/>
+          <ref bean="SecondaryStorageDiscoverer"/>
+          <ref bean="KvmServerDiscoverer"/>
+          <ref bean="BareMetalDiscoverer"/>
+          <ref bean="OvmDiscoverer"/>
+       </list>
+    </property>
   </bean>
 
-  <bean id="BareMetalPlanner" class="com.cloud.baremetal.manager.BareMetalPlanner">
-    <property name="name" value="BareMetal Fit"/>
-  </bean>
-    
-  <bean id="BaremetalPlannerSelector" class="com.cloud.baremetal.manager.BaremetalPlannerSelector">
-    <property name="name" value="BaremetalPlannerSelector"/>
+  <bean id="highAvailabilityManagerExtImpl" class="com.cloud.ha.HighAvailabilityManagerExtImpl" >
+    <property name="Investigators">
+      <list>
+          <ref bean="CheckOnAgentInvestigator"/>
+          <ref bean="XenServerInvestigator"/>
+          <ref bean="UserVmDomRInvestigator"/>
+          <ref bean="ManagementIPSystemVMInvestigator"/>
+      </list>
+    </property>
+    <property name="FenceBuilders">
+      <list>
+          <ref bean="XenServerFencer"/>
+          <ref bean="KVMFencer"/>
+          <ref bean="OvmFencer"/>
+      </list>
+    </property>
   </bean>
 
-  <bean id="HypervisorPlannerSelector" class="com.cloud.deploy.HypervisorVmPlannerSelector">
-    <property name="name" value="HypervisorPlannerSelector"/>
-  </bean>
-    
-   
-  <!--
-    Network Gurus
-  -->
-  <bean id="StorageNetworkGuru" class="com.cloud.network.guru.StorageNetworkGuru">
-    <property name="name" value="StorageNetworkGuru"/>
-  </bean>
-  <bean id="ExternalGuestNetworkGuru" class="com.cloud.network.guru.ExternalGuestNetworkGuru">
-    <property name="name" value="ExternalGuestNetworkGuru"/>
-  </bean>
-  <bean id="PublicNetworkGuru" class="com.cloud.network.guru.PublicNetworkGuru">
-    <property name="name" value="PublicNetworkGuru"/>
-  </bean>
-  <bean id="PodBasedNetworkGuru" class="com.cloud.network.guru.PodBasedNetworkGuru">
-    <property name="name" value="PodBasedNetworkGuru"/>
-  </bean>
-  <bean id="ControlNetworkGuru" class="com.cloud.network.guru.ControlNetworkGuru">
-    <property name="name" value="ControlNetworkGuru"/>
-  </bean>
-  <bean id="DirectNetworkGuru" class="com.cloud.network.guru.DirectNetworkGuru">
-    <property name="name" value="DirectNetworkGuru"/>
-  </bean>
-  <bean id="DirectPodBasedNetworkGuru" class="com.cloud.network.guru.DirectPodBasedNetworkGuru">
-    <property name="name" value="DirectPodBasedNetworkGuru"/>
-  </bean>
-  <bean id="OvsGuestNetworkGuru" class="com.cloud.network.guru.OvsGuestNetworkGuru">
-    <property name="name" value="OvsGuestNetworkGuru"/>
-  </bean>
-  <bean id="PrivateNetworkGuru" class="com.cloud.network.guru.PrivateNetworkGuru">
-    <property name="name" value="PrivateNetworkGuru"/>
-  </bean>
-  <bean id="NiciraNvpGuestNetworkGuru" class="com.cloud.network.guru.NiciraNvpGuestNetworkGuru">
-    <property name="name" value="NiciraNvpGuestNetworkGuru"/>
-  </bean>
-  
-<!--  
-  <bean id="BigSwitchVnsGuestNetworkGuru" class=".BigSwitchVnsGuestNetworkGuru">
-    <property name="name" value="com.cloud.network.guru.BigSwitchVnsGuestNetworkGuru"/>
-  </bean>
--->
- 
-  <!--
-   Hypervisor Gurus
-  -->
-  <bean id="XenServerGuru" class="com.cloud.hypervisor.XenServerGuru">
-    <property name="name" value="XenServerGuru"/>
-  </bean>
-  
-  <bean id="KVMGuru" class="com.cloud.hypervisor.KVMGuru">
-    <property name="name" value="KVMGuru"/>
-  </bean>
-  
-  <bean id="HypervGuru" class="com.cloud.hypervisor.guru.HypervGuru">
-    <property name="name" value="HypervGuru"/>
+  <bean id="clusteredVirtualMachineManagerImpl" class="com.cloud.vm.ClusteredVirtualMachineManagerImpl" >
+    <property name="HostAllocators">
+      <list>
+          <ref bean="FirstFitRouting"/>
+      </list>
+    </property>
+    <property name="Planners">
+      <list>
+          <ref bean="FirstFitPlanner" />
+          <ref bean="UserDispersingPlanner" />
+          <ref bean="UserConcentratedPodPlanner" />
+          <ref bean="BareMetalPlanner" />
+      </list>
+    </property>
   </bean>
 
-  <bean id="OvmGuru" class="com.cloud.ovm.hypervisor.OvmGuru">
-    <property name="name" value="OvmGuru"/>
-  </bean>
-  
-  <bean id="SimulatorGuru" class="com.cloud.simulator.SimulatorGuru">
-    <property name="name" value="SimulatorGuru"/>
+  <bean id="networkManagerImpl" class="com.cloud.network.NetworkManagerImpl" >
+    <property name="NetworkGurus">
+      <list>
+          <ref bean="StorageNetworkGuru"/>
+          <ref bean="ExternalGuestNetworkGuru"/>
+          <ref bean="PublicNetworkGuru"/>
+          <ref bean="PodBasedNetworkGuru"/>
+          <ref bean="DirectPodBasedNetworkGuru"/>
+          <ref bean="ControlNetworkGuru"/>
+          <ref bean="DirectNetworkGuru"/>
+          <ref bean="OvsGuestNetworkGuru"/>
+          <ref bean="PrivateNetworkGuru"/>
+      </list>
+    </property>
+    <property name="NetworkElements">
+      <list>
+          <ref bean="VirtualRouter"/>
+          <ref bean="Ovs"/>
+          <ref bean="SecurityGroupProvider"/>
+          <ref bean="VpcVirtualRouter"/>
+          <ref bean="BareMetalDhcp"/>
+          <ref bean="BareMetalPxe"/>
+          <ref bean="BareMetalUserdata"/>
+      </list>
+    </property>
+    <property name="IpDeployers">
+      <list>
+          <ref bean="elasticLoadBalancerElement"/>
+          <ref bean="VirtualRouter"/>
+          <ref bean="VpcVirtualRouter"/>
+      </list>
+    </property>
+    <property name="DhcpProviders">
+      <list>
+          <ref bean="VirtualRouter"/>
+          <ref bean="VpcVirtualRouter"/>
+          <ref bean="BareMetalDhcp"/>
+      </list>
+    </property>
   </bean>
 
-  <bean id="BaremetalGuru" class="com.cloud.baremetal.manager.BareMetalGuru">
-    <property name="name" value="BaremetalGuru"/>
+  <bean id="networkModelImpl" class="com.cloud.network.NetworkModelImpl">
+    <property name="NetworkElements">
+      <list>
+          <ref bean="VirtualRouter"/>
+          <ref bean="Ovs"/>
+          <ref bean="SecurityGroupProvider"/>
+          <ref bean="VpcVirtualRouter"/>
+          <ref bean="BareMetalDhcp"/>
+          <ref bean="BareMetalPxe"/>
+          <ref bean="BareMetalUserdata"/>
+      </list>
+    </property>
   </bean>
-  
+
+  <bean id="GlobalLoadBalancingRulesServiceImpl" class ="org.apache.cloudstack.region.gslb.GlobalLoadBalancingRulesServiceImpl" />
+
 </beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/646c4fb7/client/tomcatconf/nonossComponentContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/nonossComponentContext.xml.in b/client/tomcatconf/nonossComponentContext.xml.in
index 0b02eb6..820dcb7 100644
--- a/client/tomcatconf/nonossComponentContext.xml.in
+++ b/client/tomcatconf/nonossComponentContext.xml.in
@@ -36,7 +36,7 @@
      Non-OSS deployment component configuration
   -->
   <bean id="premiumDatabaseUpgradeChecker" class="com.cloud.upgrade.PremiumDatabaseUpgradeChecker"/>
-  
+
   <!--
     DAO with customized configuration under non-OSS deployment
   -->
@@ -45,12 +45,12 @@
       <map>
         <entry key="premium" value="true" />
       </map>
-    </property>  
+    </property>
   </bean>
 
   <!--
     VMware support components
-  -->  
+  -->
   <bean id="VmwareFencer" class="com.cloud.ha.VmwareFencer">
     <property name="name" value="VMwareFenceBuilder"/>
   </bean>
@@ -84,7 +84,7 @@
 
   <!--
     Netapp support components
-  -->  
+  -->
   <bean id="lunDaoImpl" class="com.cloud.netapp.dao.LunDaoImpl" />
   <bean id="poolDaoImpl" class="com.cloud.netapp.dao.PoolDaoImpl" />
   <bean id="netappVolumeDaoImpl" class="com.cloud.netapp.dao.VolumeDaoImpl" />
@@ -96,7 +96,7 @@
   <bean id="JuniperSRX" class="com.cloud.network.element.JuniperSRXExternalFirewallElement">
     <property name="name" value="JuniperSRX"/>
   </bean>
-  
+
   <!--
     NetScalar support components
   -->
@@ -104,17 +104,17 @@
   <bean id="Netscaler" class="com.cloud.network.element.NetscalerElement">
     <property name="name" value="Netscaler"/>
   </bean>
-  
+
   <!--
     F5BigIP support components
   -->
   <bean id="F5BigIP" class="com.cloud.network.element.F5ExternalLoadBalancerElement">
     <property name="name" value="F5BigIP"/>
   </bean>
-  
+
   <!--
     Cisco Nexus support components
-  -->  
+  -->
   <bean id="ciscoNexusVSMDeviceDaoImpl" class="com.cloud.network.dao.CiscoNexusVSMDeviceDaoImpl" />
   <bean id="CiscoNexus1000vVSM" class="com.cloud.network.element.CiscoNexusVSMElement">
     <property name="name" value="CiscoNexus1000vVSM"/>
@@ -122,13 +122,13 @@
   
   <!--
     BigSwitch support components
-  -->  
+  -->
   <bean id="bigSwitchVnsDaoImpl" class="com.cloud.network.dao.BigSwitchVnsDaoImpl" />
   <bean id="bigSwitchVnsElement" class="com.cloud.network.element.BigSwitchVnsElement">
     <property name="name" value="BigSwitchVnsElement"/>
   </bean>
 
-  <!-- 
+  <!--
     Managers & pluggable adapters configuration under non-OSS deployment
   -->
   <bean id="accountManagerImpl" class="com.cloud.user.AccountManagerImpl" >
@@ -144,7 +144,7 @@
       </list>
     </property>
   </bean>
-  
+
   <bean id="managementServerImpl" class ="com.cloud.server.ManagementServerImpl">
     <property name="UserAuthenticators">
       <list>
@@ -163,22 +163,17 @@
     <property name="StoragePoolAllocators">
       <list>
           <ref bean="LocalStoragePoolAllocator"/>
-          <ref bean="clusterScopeStoragePoolAllocator"/>
-          <ref bean="zoneWideStoragePoolAllocator"/>
-          <ref bean="garbageCollectingStoragePoolAllocator"/>
+          <ref bean="FirstFitStoragePoolAllocator"/>
       </list>
     </property>
   </bean>
 
   <bean id="FirstFitPlanner" class="com.cloud.deploy.FirstFitPlanner">
     <property name="name" value="First Fit"/>
-
     <property name="StoragePoolAllocators">
       <list>
           <ref bean="LocalStoragePoolAllocator"/>
-          <ref bean="clusterScopeStoragePoolAllocator"/>
-          <ref bean="zoneWideStoragePoolAllocator"/>
-          <ref bean="garbageCollectingStoragePoolAllocator"/>
+          <ref bean="FirstFitStoragePoolAllocator"/>
       </list>
     </property>
     <property name="HostAllocators">
@@ -199,9 +194,7 @@
           <ref bean="XcpServerDiscoverer"/>
           <ref bean="SecondaryStorageDiscoverer"/>
           <ref bean="KvmServerDiscoverer"/>
-<!--          
           <ref bean="BareMetalDiscoverer"/>
--->
           <ref bean="OvmDiscoverer"/>
           <ref bean="vmwareServerDiscoverer"/>
        </list>
@@ -239,13 +232,11 @@
           <ref bean="FirstFitPlanner" />
           <ref bean="UserDispersingPlanner" />
           <ref bean="UserConcentratedPodPlanner" />
-<!--
           <ref bean="BareMetalPlanner" />
--->
       </list>
     </property>
   </bean>
-  
+
   <bean id="networkManagerImpl" class="com.cloud.network.NetworkManagerImpl" >
     <property name="NetworkGurus">
       <list>
@@ -271,11 +262,9 @@
           <ref bean="Ovs"/>
           <ref bean="SecurityGroupProvider"/>
           <ref bean="VpcVirtualRouter"/>
-<!--
           <ref bean="BareMetalDhcp"/>
           <ref bean="BareMetalPxe"/>
           <ref bean="BareMetalUserdata"/>
--->    
       </list>
     </property>
     <property name="IpDeployers">
@@ -289,9 +278,7 @@
       <list>
           <ref bean="VirtualRouter"/>
           <ref bean="VpcVirtualRouter"/>
-<!--
           <ref bean="BareMetalDhcp"/>
--->
       </list>
     </property>
   </bean>
@@ -308,11 +295,9 @@
           <ref bean="Ovs"/>
           <ref bean="SecurityGroupProvider"/>
           <ref bean="VpcVirtualRouter"/>
-<!--
           <ref bean="BareMetalDhcp"/>
           <ref bean="BareMetalPxe"/>
           <ref bean="BareMetalUserdata"/>
--->    
       </list>
     </property>
   </bean>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/646c4fb7/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java
index 226bf05..d77aa1f 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -243,16 +243,41 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
     @Inject
     PodVlanMapDao _podVlanMapDao;
 
-    @Inject 
     List<NetworkGuru> _networkGurus;
-
-    @Inject  protected List<NetworkElement> _networkElements;
-
-    @Inject NetworkDomainDao _networkDomainDao;
-    @Inject List<IpDeployer> _ipDeployers;
-    @Inject List<DhcpServiceProvider> _dhcpProviders;
- 
-    @Inject
+    public List<NetworkGuru> getNetworkGurus() {
+		return _networkGurus;
+	}
+	public void setNetworkGurus(List<NetworkGuru> _networkGurus) {
+		this._networkGurus = _networkGurus;
+	}
+
+	List<NetworkElement> _networkElements;
+    public List<NetworkElement> getNetworkElements() {
+		return _networkElements;
+	}
+	public void setNetworkElements(List<NetworkElement> _networkElements) {
+		this._networkElements = _networkElements;
+	}
+
+	@Inject NetworkDomainDao _networkDomainDao;
+
+	List<IpDeployer> _ipDeployers;
+    public List<IpDeployer> getIpDeployers() {
+		return _ipDeployers;
+	}
+	public void setIpDeployers(List<IpDeployer> _ipDeployers) {
+		this._ipDeployers = _ipDeployers;
+	}
+
+	List<DhcpServiceProvider> _dhcpProviders;
+    public List<DhcpServiceProvider> getDhcpProviders() {
+		return _dhcpProviders;
+	}
+	public void setDhcpProviders(List<DhcpServiceProvider> _dhcpProviders) {
+		this._dhcpProviders = _dhcpProviders;
+	}
+
+	@Inject
     VMInstanceDao _vmDao;
     @Inject
     FirewallManager _firewallMgr;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/646c4fb7/server/src/com/cloud/network/NetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkModelImpl.java b/server/src/com/cloud/network/NetworkModelImpl.java
index d1326b5..e6361b0 100644
--- a/server/src/com/cloud/network/NetworkModelImpl.java
+++ b/server/src/com/cloud/network/NetworkModelImpl.java
@@ -143,9 +143,15 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel {
     @Inject
     PodVlanMapDao _podVlanMapDao;
 
-    @Inject List<NetworkElement> _networkElements;
-    
-    @Inject
+    List<NetworkElement> _networkElements;
+    public List<NetworkElement> getNetworkElements() {
+		return _networkElements;
+	}
+	public void setNetworkElements(List<NetworkElement> _networkElements) {
+		this._networkElements = _networkElements;
+	}
+
+	@Inject
     NetworkDomainDao _networkDomainDao;
     @Inject
     VMInstanceDao _vmDao;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/646c4fb7/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index baa09bc..918b118 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -490,6 +490,14 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
 	_userAuthenticators = authenticators;
     }
 
+    public List<HostAllocator> getHostAllocators() {
+		return _hostAllocators;
+	}
+
+	public void setHostAllocators(List<HostAllocator> _hostAllocators) {
+		this._hostAllocators = _hostAllocators;
+	}
+
 	@Override
 	public boolean configure(String name, Map<String, Object> params)
 			throws ConfigurationException {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/646c4fb7/server/src/com/cloud/user/AccountManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java
index 93bb725..86813e8 100755
--- a/server/src/com/cloud/user/AccountManagerImpl.java
+++ b/server/src/com/cloud/user/AccountManagerImpl.java
@@ -230,9 +230,9 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
     UserVO _systemUser;
     AccountVO _systemAccount;
 
-    @Inject
     List<SecurityChecker> _securityCheckers;
-    int _cleanupInterval;
+
+	int _cleanupInterval;
 
     public List<UserAuthenticator> getUserAuthenticators() {
 	return _userAuthenticators;
@@ -242,6 +242,14 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
 	_userAuthenticators = authenticators;
     }
 
+    public List<SecurityChecker> getSecurityCheckers() {
+		return _securityCheckers;
+	}
+
+	public void setSecurityCheckers(List<SecurityChecker> securityCheckers) {
+		this._securityCheckers = securityCheckers;
+	}
+
     @Override
     public boolean configure(final String name, final Map<String, Object> params) throws ConfigurationException {
         _systemAccount = _accountDao.findById(AccountVO.ACCOUNT_ID_SYSTEM);


[08/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
CLOUDSTACK-1065: cloudstack UI - regions menu - implement create region action.


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

Branch: refs/heads/marvin_refactor
Commit: 8b15988a01d9737e49c77d6d41f7943e1a7f471f
Parents: e9cc875
Author: Jessica Wang <je...@citrix.com>
Authored: Tue Mar 19 13:14:29 2013 -0700
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:01:09 2013 +0530

----------------------------------------------------------------------
 ui/scripts/regions.js |   57 ++++++++++++++-----------------------------
 1 files changed, 19 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8b15988a/ui/scripts/regions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/regions.js b/ui/scripts/regions.js
index 8839dec..917b761 100644
--- a/ui/scripts/regions.js
+++ b/ui/scripts/regions.js
@@ -27,8 +27,10 @@
 
             args.response.success({
               data: regions ? regions : [
-                { id: -1, name: _l('label.no.data') }
-              ]
+                { id: -1, name: '(Default)' }
+              ],
+              activeRegionID: cloudStack.context.users.regionid ?
+                cloudStack.context.users.regionid : 1
             });
           }
         }); 
@@ -53,34 +55,34 @@
             fields: {
               id: { label: 'label.id', validation: { required: true } },
               name: { label: 'label.name', validation: { required: true } },
-              endpoint: { label: 'label.endpoint', validation: { required: true } }             
+              endpoint: { label: 'label.endpoint', validation: { required: true } }
             }
           },
-          action: function(args) {					  
-						var data = {							
+          action: function(args) {
+						var data = {
 							id: args.data.id,
 							name: args.data.name,
 							endpoint: args.data.endpoint
-						};		
-						
+						};
+
             $.ajax({
               url: createURL('addRegion'),
               data: data,
-              success: function(json) {							 
+              success: function(json) {
                 var item = json.addregionresponse.region;
-                args.response.success({data: item});               
-                $(window).trigger('cloudStack.refreshRegions');
+                args.response.success({data: item});
+                //$(window).trigger('cloudStack.refreshRegions');
               },
               error: function(json) {
                 args.response.error(parseXMLHttpResponse(json));
               } 
             });
-          },										
+          },
 					notification: {
 						poll: function(args) {
 							args.complete();
 						}
-					}			
+					}
         }
       },
       dataProvider: function(args) {
@@ -104,15 +106,9 @@
           edit: {
             label: 'label.edit.region',
             action: function(args) {
-							var data = {
-							  id: args.context.regions[0].id,
-								name: args.data.name,
-								endpoint: args.data.endpoint
-							};							
-						
               $.ajax({
                 url: createURL('updateRegion'),
-                data: data,
+                data: args.data,
                 success: function(json) {
                   args.response.success();
                   $(window).trigger('cloudStack.refreshRegions');
@@ -128,22 +124,7 @@
             messages: {
               notification: function() { return 'label.remove.region'; },
               confirm: function() { return 'message.remove.region'; }
-            },						
-						preAction: function(args) {
-						  var region = args.context.regions[0];							
-														
-							/* e.g.
-							region.endpoint	== "http://localhost:8080/client/" 
-							document.location.href == "http://localhost:8080/client/#" 
-							*/
-							/*
-							if(document.location.href.indexOf(region.endpoint) != -1) {	
-							  cloudStack.dialog.notice({ message: _l('You can not remove the region that you are currently in.') });
-                return false;
-							}				
-              */							
-              return true;
-            },	
+            },
             action: function(args) {
               var region = args.context.regions[0];
 
@@ -166,11 +147,11 @@
             title: 'label.details',
             fields: [
               {
-                id: { label: 'label.id' }
+                name: { label: 'label.name', isEditable: true },
               },
               {
-							  name: { label: 'label.name', isEditable: true },
-                endpoint: { label: 'label.endpoint', isEditable: true }                
+                endpoint: { label: 'label.endpoint', isEditable: true },
+                id: { label: 'label.id', isEditable: true }
               }
             ],
             dataProvider: function(args) {								  


[04/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
argparse TODO implemented

1. deployAndRun will use the more modern argparse module
2. improving logging within the remoteSSHClient, moving to debug and
default logging to INFO
3. removing dependance on the xmlrunner. use nose --with-xunit instead

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


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

Branch: refs/heads/marvin_refactor
Commit: dc573f557d449f6cfca580980027c42a31998d17
Parents: a995526
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Wed Mar 13 11:49:08 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:00:35 2013 +0530

----------------------------------------------------------------------
 tools/marvin/marvin/TestCaseExecuteEngine.py |    9 +----
 tools/marvin/marvin/deployAndRun.py          |   38 ++++++++------------
 tools/marvin/marvin/remoteSSHClient.py       |    9 ++---
 tools/marvin/setup.py                        |    5 +--
 4 files changed, 23 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc573f55/tools/marvin/marvin/TestCaseExecuteEngine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/TestCaseExecuteEngine.py b/tools/marvin/marvin/TestCaseExecuteEngine.py
index 3c34c7e..144c5db 100644
--- a/tools/marvin/marvin/TestCaseExecuteEngine.py
+++ b/tools/marvin/marvin/TestCaseExecuteEngine.py
@@ -16,7 +16,6 @@
 # under the License.
 
 import unittest
-import xmlrunner
 import os
 import sys
 import logging
@@ -27,7 +26,7 @@ def testCaseLogger(message, logger=None):
         logger.debug(message)
 
 class TestCaseExecuteEngine(object):
-    def __init__(self, testclient, config, testcaseLogFile=None, testResultLogFile=None, format="text", xmlDir="xml-reports"):
+    def __init__(self, testclient, config, testcaseLogFile=None, testResultLogFile=None):
         """
         Initialize the testcase execution engine, just the basics here
         @var testcaseLogFile: client log file
@@ -56,9 +55,7 @@ class TestCaseExecuteEngine(object):
             self.testResultLogFile = fp
         else:
             self.testResultLogFile = sys.stdout
-        if self.format == "xml"  and (xmlDir is not None):
-            self.xmlDir = xmlDir
-            
+
     def loadTestsFromDir(self, testDirectory):
         """ Load the test suites from a package with multiple test files """
         self.suite = self.loader.discover(testDirectory)
@@ -94,5 +91,3 @@ class TestCaseExecuteEngine(object):
         if self.suite:
             if self.format == "text":
                 unittest.TextTestRunner(stream=self.testResultLogFile, verbosity=2).run(self.suite)
-            elif self.format == "xml":
-                xmlrunner.XMLTestRunner(output=self.xmlDir).run(self.suite)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc573f55/tools/marvin/marvin/deployAndRun.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/deployAndRun.py b/tools/marvin/marvin/deployAndRun.py
index e7b005c..54161eb 100644
--- a/tools/marvin/marvin/deployAndRun.py
+++ b/tools/marvin/marvin/deployAndRun.py
@@ -17,22 +17,22 @@
 
 import deployDataCenter
 import TestCaseExecuteEngine
-from optparse import OptionParser
-import os
-
+from argparse import ArgumentParser
 if __name__ == "__main__":
 
-    parser = OptionParser() #TODO: deprecate and use the argparse module
-  
-    parser.add_option("-c", "--config", action="store", default="./datacenterCfg", dest="config", help="the path where the json config file generated, by default is ./datacenterCfg")
-    parser.add_option("-d", "--directory", dest="testCaseFolder", help="the test case directory")
-    parser.add_option("-r", "--result", dest="result", help="test result log file")
-    parser.add_option("-t", "--client", dest="testcaselog", help="test case log file")
-    parser.add_option("-l", "--load", dest="load", action="store_true", help="only load config, do not deploy, it will only run testcase")
-    parser.add_option("-f", "--file", dest="module", help="run tests in the given file")
-    parser.add_option("-x", "--xml", dest="xmlrunner", help="use the xml runner to generate xml reports and path to store xml files")
+    parser = ArgumentParser()
+
+    parser.add_argument("-d", "--directory", dest="testCaseFolder", help="the test case directory")
+    parser.add_argument("-f", "--file", dest="module", help="run tests in the given file")
+    parser.add_argument("-r", "--result", dest="result", help="test result log file", default='/tmp/t.log')
+    parser.add_argument("-t", "--client", dest="testcaselog", help="test case log file", default='/tmp/r.log')
+    parser.add_argument("-c", "--config", action="store", default="./datacenterCfg", dest="config",
+        help="the path where the json config file generated, by default is ./datacenterCfg")
+    parser.add_argument("-l", "--load", dest="load", action="store_true",
+        help="only load config, do not deploy, it will only run testcase")
+
     (options, args) = parser.parse_args()
-    
+
     testResultLogFile = None
     if options.result is not None:
         testResultLogFile = options.result
@@ -46,12 +46,6 @@ if __name__ == "__main__":
     else:
         deploy.deploy()
         
-    fmt = "text"
-    xmlDir = None
-    if options.xmlrunner is not None:
-        xmlDir = options.xmlrunner
-        fmt = "xml"
-    
     if options.testCaseFolder is None:
         if options.module is None:
             parser.print_usage()
@@ -61,15 +55,13 @@ if __name__ == "__main__":
             TestCaseExecuteEngine.TestCaseExecuteEngine(deploy.testClient,
                                                         deploy.getCfg(),
                                                         testCaseLogFile,
-                                                        testResultLogFile, fmt,
-                                                        xmlDir)
+                                                        testResultLogFile)
             engine.loadTestsFromFile(options.module)
             engine.run()
     else:
        engine = TestCaseExecuteEngine.TestCaseExecuteEngine(deploy.testClient,
                                                             deploy.getCfg(),
                                                             testCaseLogFile,
-                                                            testResultLogFile,
-                                                            fmt, xmlDir)
+                                                            testResultLogFile)
        engine.loadTestsFromDir(options.testCaseFolder)
        engine.run()

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc573f55/tools/marvin/marvin/remoteSSHClient.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/remoteSSHClient.py b/tools/marvin/marvin/remoteSSHClient.py
index 95a9ada..4fb2f0d 100644
--- a/tools/marvin/marvin/remoteSSHClient.py
+++ b/tools/marvin/marvin/remoteSSHClient.py
@@ -23,7 +23,7 @@ import logging
 from contextlib import closing
 
 class remoteSSHClient(object):
-    def __init__(self, host, port, user, passwd, retries = 10):
+    def __init__(self, host, port, user, passwd, retries = 10, log_lvl=logging.INFO):
         self.host = host
         self.port = port
         self.user = user
@@ -32,14 +32,14 @@ class remoteSSHClient(object):
         self.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
         self.logger = logging.getLogger('sshClient')
         ch = logging.StreamHandler()
-        ch.setLevel(logging.DEBUG)
+        ch.setLevel(log_lvl)
         self.logger.addHandler(ch)
 
         retry_count = retries
         while True:
             try:
                 self.ssh.connect(str(host),int(port), user, passwd)
-                self.logger.debug("connecting to server %s with user %s passwd %s"%(str(host), user, passwd))
+                self.logger.debug("SSH connect: %s@%s with passwd %s"%(user, str(host), passwd))
             except paramiko.SSHException, sshex:
                 if retry_count == 0:
                     raise cloudstackException.InvalidParameterException(repr(sshex))
@@ -52,7 +52,6 @@ class remoteSSHClient(object):
         
     def execute(self, command):
         stdin, stdout, stderr = self.ssh.exec_command(command)
-        self.logger.debug("sending command %s to host %s"%(command, str(self.host)))
         output = stdout.readlines()
         errors = stderr.readlines()
         results = []
@@ -64,7 +63,7 @@ class remoteSSHClient(object):
         else:
             for strOut in output:
                 results.append(strOut.rstrip())
-        self.logger.debug("command %s returned %s"%(command, results))
+        self.logger.debug("{Cmd: %s via Host: %s} {returns: %s}"%(command, str(self.host), results))
         return results
     
     def scp(self, srcFile, destPath):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc573f55/tools/marvin/setup.py
----------------------------------------------------------------------
diff --git a/tools/marvin/setup.py b/tools/marvin/setup.py
index fea53d0..f8198d7 100644
--- a/tools/marvin/setup.py
+++ b/tools/marvin/setup.py
@@ -37,7 +37,6 @@ setup(name="Marvin",
       install_requires=[
           "mysql-connector-python",
           "paramiko",
-          "nose",
-          "unittest-xml-reporting>1.2"
-      ],         
+          "nose"
+      ],
      )


[12/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
CLOUDSTACK-1065: cloudstack UI - AWS Style Regions - implement region switching action triggered by region dropdown on top menu.


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

Branch: refs/heads/marvin_refactor
Commit: 7c5f5c336612ceda59229c09ca16f425ecd933a4
Parents: 37e9c91
Author: Jessica Wang <je...@citrix.com>
Authored: Wed Mar 20 11:58:17 2013 -0700
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:02:00 2013 +0530

----------------------------------------------------------------------
 ui/scripts/cloud.core.callbacks.js |   22 ++++++++++----------
 ui/scripts/cloudStack.js           |   17 ++------------
 ui/scripts/ui-custom/regions.js    |   34 +++++++++++-------------------
 3 files changed, 27 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7c5f5c33/ui/scripts/cloud.core.callbacks.js
----------------------------------------------------------------------
diff --git a/ui/scripts/cloud.core.callbacks.js b/ui/scripts/cloud.core.callbacks.js
index 1a9e045..19d759e 100644
--- a/ui/scripts/cloud.core.callbacks.js
+++ b/ui/scripts/cloud.core.callbacks.js
@@ -52,29 +52,29 @@ Below is a sample login attempt
 var clientApiUrl = "/client/api";
 var clientConsoleUrl   = "/client/console";
 
-$(document).ready(function() {		
+$(document).ready(function() {
   /*
 	condition 1: If window.location.href contains parameter 'loginUrl', save the parameter's value to a cookie, then reload the page without any URL parameter.
-	(After the page is reloaded without any URL parameter, it will fall in condition 2.) 
+	(After the page is reloaded without any URL parameter, it will fall in condition 2.)
 	*/
-	if ($.urlParam('loginUrl') != 0) {	 
+	if ($.urlParam('loginUrl') != 0) {
 		$.cookie('loginUrl', $.urlParam('loginUrl'), { expires: 1});
-		document.location.href = window.location.href.substring(0, window.location.href.indexOf('?'));	
+	  document.location.href = '/client/';
 	}
 	
-	/* 
-	condition 2: If window.location.href does not contain parameter 'loginUrl' but cookie 'loginUrl' exists, 
-	save the cookie's value to g_regionUrlParam (a global variable for switching regions), 
+	/*
+	condition 2: If window.location.href does not contain parameter 'loginUrl' but cookie 'loginUrl' exists,
+	save the cookie's value to g_regionUrlParam (a global variable for switching regions),
 	then call login API to set g_loginResponse (a global variable for single-sign-on).
 	*/
-	else if($.cookie('loginUrl') != null) {	  
-	  g_regionUrlParam = '?loginUrl=' + $.cookie('loginUrl');		
+	else if($.cookie('loginUrl') != null) {
+	  g_regionUrlParam = '?loginUrl=' + $.cookie('loginUrl');
 		$.ajax({
 			url: unescape(clientApiUrl + "?" + $.cookie('loginUrl')),
 			dataType: "json",
 			async: false,
 			success: function(json) {
-				g_loginResponse = json.loginresponse;				
+				g_loginResponse = json.loginresponse;
 			},
 			error: function() {
 				onLogoutCallback();
@@ -85,7 +85,7 @@ $(document).ready(function() {
 			}
 		});
 	}
-	
+
 });
 
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7c5f5c33/ui/scripts/cloudStack.js
----------------------------------------------------------------------
diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js
index 985627b..51a4deb 100644
--- a/ui/scripts/cloudStack.js
+++ b/ui/scripts/cloudStack.js
@@ -253,7 +253,7 @@
 
 				g_regionUrlParam = '?loginUrl=' + escape("command=login" + array1.join("") + "&response=json");
 				$.cookie('loginUrl', escape("command=login" + array1.join("") + "&response=json"), { expires: 1});
-				
+
         $.ajax({
           type: "POST",
           data: "command=login" + array1.join("") + "&response=json",					
@@ -385,9 +385,9 @@
 						g_domainid = null;	
 						g_timezoneoffset = null;
 						g_timezone = null;
-						g_supportELB = null;						
+						g_supportELB = null;
 						g_regionUrlParam = null;
-						
+
 						$.cookie('JSESSIONID', null);
 						$.cookie('sessionKey', null);
 						$.cookie('username', null);
@@ -456,21 +456,10 @@
             context: cloudStack.context
           });
         });
-
-        window._reloadUI = function() {
-          $('#container').html('');
-          $('#container').cloudStack(window.cloudStack);
-        };
       }
     };
 		
     document.title = 'CloudStack';
-
-    if ($.cookie('loginUrl') != null || $.urlParam('loginUrl') != 0) {
-      // SSO
-      loginArgs.hideLoginScreen = true;
-    }
-    
     cloudStack.uiCustom.login(loginArgs);
 
     // Localization

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7c5f5c33/ui/scripts/ui-custom/regions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/regions.js b/ui/scripts/ui-custom/regions.js
index 17bc86c..b29d914 100644
--- a/ui/scripts/ui-custom/regions.js
+++ b/ui/scripts/ui-custom/regions.js
@@ -27,33 +27,25 @@
         response: {
           success: function(args) {
             var data = args.data;
-            
-						var currentRegion = null;
+            var activeRegionID = args.activeRegionID;
+
             $(data).each(function() {
               var region = this;
               var regionName = region.name;
               var $li = $('<li>').append($('<span>').html(_s(region.name)));
 
               $li.data('region-data', region);
-							
-							/* e.g.
-							region.endpoint	== "http://localhost:8080/client/" 
-							document.location.href == "http://localhost:8080/client/#" 
-							*/
-							if(document.location.href.indexOf(region.endpoint) != -1) {							
-                currentRegion = region;	
-								$li.addClass('active');
-							}
-														
-              $regionList.append($li);							
+
+              if (region.id == activeRegionID) {
+                $li.addClass('active');
+              }
+              
+              $regionSwitcherButton.find('.title')
+                .html(regionName)
+                .attr('title', regionName);
+              
+              $regionList.append($li);
             });
-							
-            if(currentRegion != null)	{						
-						  $regionSwitcherButton.find('.title').html(_s(currentRegion.name)).attr('title', _s(currentRegion.name));   
-            }		
-            else {
-              $regionSwitcherButton.find('.title').html('').attr('title', '');   
-            }						
           }
         }
       });
@@ -89,7 +81,7 @@
       closeRegionSelector({
         complete: function() {
           $('#container').prepend($('<div>').addClass('loading-overlay'));
-          
+
           document.location.href = url + g_regionUrlParam;
         }
       });


[31/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
marvin: factories for each api entity

factories will help define default test data for each entity. So a

Account.create(apiclient) returns a default account
VirtualMachine.deploy(apiclient) returns a virtualmachine etc

WIP: only skeletons, no flesh

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


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

Branch: refs/heads/marvin_refactor
Commit: 7e80721e42a406c29f328b1f0c0b76a9fdca94af
Parents: 9e38c5d
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Wed Jan 23 19:34:25 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:19:14 2013 +0530

----------------------------------------------------------------------
 .../lib/factory/AccountFromProjectFactory.py       |    8 ++++
 .../lib/factory/AccountToProjectFactory.py         |    7 +++
 .../integration/lib/factory/AlertsFactory.py       |    5 ++
 .../marvin/integration/lib/factory/ApisFactory.py  |    5 ++
 .../lib/factory/AsyncJobResultFactory.py           |    7 +++
 .../integration/lib/factory/AsyncJobsFactory.py    |    5 ++
 .../lib/factory/AutoScalePoliciesFactory.py        |    5 ++
 .../integration/lib/factory/CapabilitiesFactory.py |    5 ++
 .../integration/lib/factory/CapacityFactory.py     |    5 ++
 .../lib/factory/CloudIdentifierFactory.py          |    7 +++
 .../integration/lib/factory/ClusterFactory.py      |   25 +++++++++++
 .../integration/lib/factory/ConfigFactory.py       |    9 ++++
 .../lib/factory/ConfigurationFactory.py            |   11 +++++
 .../lib/factory/CustomCertificateFactory.py        |    8 ++++
 .../lib/factory/DefaultZoneForAccountFactory.py    |    9 ++++
 .../lib/factory/DomainChildrenFactory.py           |    5 ++
 .../integration/lib/factory/EventTypesFactory.py   |    5 ++
 .../integration/lib/factory/EventsFactory.py       |    5 ++
 .../lib/factory/FromLoadBalancerRuleFactory.py     |    8 ++++
 .../marvin/integration/lib/factory/HostFactory.py  |   31 ++++++++++++++
 .../lib/factory/HostForMaintenanceFactory.py       |    7 +++
 .../lib/factory/HostMaintenanceFactory.py          |    7 +++
 .../integration/lib/factory/HostPasswordFactory.py |    8 ++++
 .../lib/factory/HypervisorCapabilitiesFactory.py   |    9 ++++
 .../integration/lib/factory/HypervisorsFactory.py  |    5 ++
 .../lib/factory/IsoPermissionsFactory.py           |   12 +++++
 .../lib/factory/LBStickinessPoliciesFactory.py     |    7 +++
 .../factory/LoadBalancerRuleInstancesFactory.py    |    7 +++
 .../lib/factory/NetworkDeviceFactory.py            |   15 +++++++
 .../lib/factory/NetworkServiceProviderFactory.py   |   22 ++++++++++
 .../lib/factory/NiciraNvpDeviceFactory.py          |   20 +++++++++
 .../lib/factory/NiciraNvpDeviceNetworksFactory.py  |    7 +++
 .../integration/lib/factory/OsCategoriesFactory.py |    5 ++
 .../integration/lib/factory/OsTypesFactory.py      |    5 ++
 .../factory/PasswordForVirtualMachineFactory.py    |    7 +++
 .../lib/factory/ProjectAccountsFactory.py          |    7 +++
 .../lib/factory/ProjectInvitationFactory.py        |   16 +++++++
 .../lib/factory/PublicIpAddressesFactory.py        |    5 ++
 .../integration/lib/factory/RemoveFactory.py       |    5 ++
 .../lib/factory/ResourceCountFactory.py            |    7 +++
 .../lib/factory/ResourceLimitFactory.py            |   11 +++++
 .../integration/lib/factory/RouterFactory.py       |   26 ++++++++++++
 .../marvin/integration/lib/factory/S3Factory.py    |   12 +++++
 .../lib/factory/SecondaryStorageFactory.py         |    7 +++
 .../lib/factory/SecurityGroupEgressFactory.py      |   11 +++++
 .../lib/factory/SecurityGroupIngressFactory.py     |   11 +++++
 .../lib/factory/ServiceForRouterFactory.py         |    8 ++++
 .../lib/factory/ServiceForSystemVmFactory.py       |    8 ++++
 .../lib/factory/ServiceForVirtualMachineFactory.py |    8 ++++
 .../lib/factory/SnapshotPoliciesFactory.py         |   10 +++++
 .../integration/lib/factory/StaticNatFactory.py    |   13 ++++++
 .../lib/factory/StorageMaintenanceFactory.py       |   12 +++++
 .../lib/factory/SupportedNetworkServicesFactory.py |    5 ++
 .../marvin/integration/lib/factory/SwiftFactory.py |   10 +++++
 .../integration/lib/factory/SystemVmFactory.py     |   32 +++++++++++++++
 .../lib/factory/TemplatePermissionsFactory.py      |   12 +++++
 .../lib/factory/ToLoadBalancerRuleFactory.py       |    8 ++++
 .../lib/factory/TrafficMonitorFactory.py           |   18 ++++++++
 .../integration/lib/factory/TrafficTypeFactory.py  |   23 ++++++++++
 .../lib/factory/TrafficTypeImplementorsFactory.py  |    5 ++
 .../integration/lib/factory/UsageRecordsFactory.py |   14 ++++++
 .../integration/lib/factory/UsageTypesFactory.py   |    5 ++
 .../integration/lib/factory/VMPasswordFactory.py   |    7 +++
 .../integration/lib/factory/VpnUserFactory.py      |   17 ++++++++
 64 files changed, 651 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/AccountFromProjectFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/AccountFromProjectFactory.py b/tools/marvin/marvin/integration/lib/factory/AccountFromProjectFactory.py
new file mode 100644
index 0000000..ef67a93
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/AccountFromProjectFactory.py
@@ -0,0 +1,8 @@
+import factory
+from marvin.integration.lib.newbase import AccountFromProject
+class AccountFromProjectFactory(factory.Factory):
+
+    FACTORY_FOR = AccountFromProject
+
+    account = None
+    projectid = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/AccountToProjectFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/AccountToProjectFactory.py b/tools/marvin/marvin/integration/lib/factory/AccountToProjectFactory.py
new file mode 100644
index 0000000..df54c18
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/AccountToProjectFactory.py
@@ -0,0 +1,7 @@
+import factory
+from marvin.integration.lib.newbase import AccountToProject
+class AccountToProjectFactory(factory.Factory):
+
+    FACTORY_FOR = AccountToProject
+
+    projectid = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/AlertsFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/AlertsFactory.py b/tools/marvin/marvin/integration/lib/factory/AlertsFactory.py
new file mode 100644
index 0000000..18ee4e0
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/AlertsFactory.py
@@ -0,0 +1,5 @@
+import factory
+from marvin.integration.lib.newbase import Alerts
+class AlertsFactory(factory.Factory):
+
+    FACTORY_FOR = Alerts

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/ApisFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/ApisFactory.py b/tools/marvin/marvin/integration/lib/factory/ApisFactory.py
new file mode 100644
index 0000000..78b5986
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/ApisFactory.py
@@ -0,0 +1,5 @@
+import factory
+from marvin.integration.lib.newbase import Apis
+class ApisFactory(factory.Factory):
+
+    FACTORY_FOR = Apis

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/AsyncJobResultFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/AsyncJobResultFactory.py b/tools/marvin/marvin/integration/lib/factory/AsyncJobResultFactory.py
new file mode 100644
index 0000000..d36fad8
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/AsyncJobResultFactory.py
@@ -0,0 +1,7 @@
+import factory
+from marvin.integration.lib.newbase import AsyncJobResult
+class AsyncJobResultFactory(factory.Factory):
+
+    FACTORY_FOR = AsyncJobResult
+
+    jobid = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/AsyncJobsFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/AsyncJobsFactory.py b/tools/marvin/marvin/integration/lib/factory/AsyncJobsFactory.py
new file mode 100644
index 0000000..c85b281
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/AsyncJobsFactory.py
@@ -0,0 +1,5 @@
+import factory
+from marvin.integration.lib.newbase import AsyncJobs
+class AsyncJobsFactory(factory.Factory):
+
+    FACTORY_FOR = AsyncJobs

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/AutoScalePoliciesFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/AutoScalePoliciesFactory.py b/tools/marvin/marvin/integration/lib/factory/AutoScalePoliciesFactory.py
new file mode 100644
index 0000000..2cf6902
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/AutoScalePoliciesFactory.py
@@ -0,0 +1,5 @@
+import factory
+from marvin.integration.lib.newbase import AutoScalePolicies
+class AutoScalePoliciesFactory(factory.Factory):
+
+    FACTORY_FOR = AutoScalePolicies

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/CapabilitiesFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/CapabilitiesFactory.py b/tools/marvin/marvin/integration/lib/factory/CapabilitiesFactory.py
new file mode 100644
index 0000000..bb40fd4
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/CapabilitiesFactory.py
@@ -0,0 +1,5 @@
+import factory
+from marvin.integration.lib.newbase import Capabilities
+class CapabilitiesFactory(factory.Factory):
+
+    FACTORY_FOR = Capabilities

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/CapacityFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/CapacityFactory.py b/tools/marvin/marvin/integration/lib/factory/CapacityFactory.py
new file mode 100644
index 0000000..5f4c406
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/CapacityFactory.py
@@ -0,0 +1,5 @@
+import factory
+from marvin.integration.lib.newbase import Capacity
+class CapacityFactory(factory.Factory):
+
+    FACTORY_FOR = Capacity

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/CloudIdentifierFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/CloudIdentifierFactory.py b/tools/marvin/marvin/integration/lib/factory/CloudIdentifierFactory.py
new file mode 100644
index 0000000..22c27d7
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/CloudIdentifierFactory.py
@@ -0,0 +1,7 @@
+import factory
+from marvin.integration.lib.newbase import CloudIdentifier
+class CloudIdentifierFactory(factory.Factory):
+
+    FACTORY_FOR = CloudIdentifier
+
+    userid = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/ClusterFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/ClusterFactory.py b/tools/marvin/marvin/integration/lib/factory/ClusterFactory.py
new file mode 100644
index 0000000..2697f6a
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/ClusterFactory.py
@@ -0,0 +1,25 @@
+import factory
+from marvin.integration.lib.newbase import Cluster
+class ClusterFactory(factory.Factory):
+
+    FACTORY_FOR = Cluster
+
+    clustername = None
+    clustertype = None
+    hypervisor = None
+    podid = None
+    zoneid = None
+
+
+    FACTORY_FOR = Cluster
+
+
+
+    FACTORY_FOR = Cluster
+
+    id = None
+
+
+    FACTORY_FOR = Cluster
+
+    id = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/ConfigFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/ConfigFactory.py b/tools/marvin/marvin/integration/lib/factory/ConfigFactory.py
new file mode 100644
index 0000000..f62c583
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/ConfigFactory.py
@@ -0,0 +1,9 @@
+import factory
+from marvin.integration.lib.newbase import Config
+class ConfigFactory(factory.Factory):
+
+    FACTORY_FOR = Config
+
+    hostname = None
+    queryfilter = None
+    searchbase = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/ConfigurationFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/ConfigurationFactory.py b/tools/marvin/marvin/integration/lib/factory/ConfigurationFactory.py
new file mode 100644
index 0000000..88c6556
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/ConfigurationFactory.py
@@ -0,0 +1,11 @@
+import factory
+from marvin.integration.lib.newbase import Configuration
+class ConfigurationFactory(factory.Factory):
+
+    FACTORY_FOR = Configuration
+
+
+
+    FACTORY_FOR = Configuration
+
+    name = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/CustomCertificateFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/CustomCertificateFactory.py b/tools/marvin/marvin/integration/lib/factory/CustomCertificateFactory.py
new file mode 100644
index 0000000..c3f8c62
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/CustomCertificateFactory.py
@@ -0,0 +1,8 @@
+import factory
+from marvin.integration.lib.newbase import CustomCertificate
+class CustomCertificateFactory(factory.Factory):
+
+    FACTORY_FOR = CustomCertificate
+
+    certificate = None
+    domainsuffix = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/DefaultZoneForAccountFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/DefaultZoneForAccountFactory.py b/tools/marvin/marvin/integration/lib/factory/DefaultZoneForAccountFactory.py
new file mode 100644
index 0000000..15da73a
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/DefaultZoneForAccountFactory.py
@@ -0,0 +1,9 @@
+import factory
+from marvin.integration.lib.newbase import DefaultZoneForAccount
+class DefaultZoneForAccountFactory(factory.Factory):
+
+    FACTORY_FOR = DefaultZoneForAccount
+
+    account = None
+    domainid = None
+    zoneid = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/DomainChildrenFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/DomainChildrenFactory.py b/tools/marvin/marvin/integration/lib/factory/DomainChildrenFactory.py
new file mode 100644
index 0000000..44d350a
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/DomainChildrenFactory.py
@@ -0,0 +1,5 @@
+import factory
+from marvin.integration.lib.newbase import DomainChildren
+class DomainChildrenFactory(factory.Factory):
+
+    FACTORY_FOR = DomainChildren

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/EventTypesFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/EventTypesFactory.py b/tools/marvin/marvin/integration/lib/factory/EventTypesFactory.py
new file mode 100644
index 0000000..5e7d718
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/EventTypesFactory.py
@@ -0,0 +1,5 @@
+import factory
+from marvin.integration.lib.newbase import EventTypes
+class EventTypesFactory(factory.Factory):
+
+    FACTORY_FOR = EventTypes

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/EventsFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/EventsFactory.py b/tools/marvin/marvin/integration/lib/factory/EventsFactory.py
new file mode 100644
index 0000000..700f5ae
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/EventsFactory.py
@@ -0,0 +1,5 @@
+import factory
+from marvin.integration.lib.newbase import Events
+class EventsFactory(factory.Factory):
+
+    FACTORY_FOR = Events

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/FromLoadBalancerRuleFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/FromLoadBalancerRuleFactory.py b/tools/marvin/marvin/integration/lib/factory/FromLoadBalancerRuleFactory.py
new file mode 100644
index 0000000..82e46cb
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/FromLoadBalancerRuleFactory.py
@@ -0,0 +1,8 @@
+import factory
+from marvin.integration.lib.newbase import FromLoadBalancerRule
+class FromLoadBalancerRuleFactory(factory.Factory):
+
+    FACTORY_FOR = FromLoadBalancerRule
+
+    id = None
+    virtualmachineids = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/HostFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/HostFactory.py b/tools/marvin/marvin/integration/lib/factory/HostFactory.py
new file mode 100644
index 0000000..fcdf074
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/HostFactory.py
@@ -0,0 +1,31 @@
+import factory
+from marvin.integration.lib.newbase import Host
+class HostFactory(factory.Factory):
+
+    FACTORY_FOR = Host
+
+    hypervisor = None
+    password = None
+    podid = None
+    url = None
+    username = None
+    zoneid = None
+
+
+    FACTORY_FOR = Host
+
+
+
+    FACTORY_FOR = Host
+
+    id = None
+
+
+    FACTORY_FOR = Host
+
+    id = None
+
+
+    FACTORY_FOR = Host
+
+    id = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/HostForMaintenanceFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/HostForMaintenanceFactory.py b/tools/marvin/marvin/integration/lib/factory/HostForMaintenanceFactory.py
new file mode 100644
index 0000000..653e37a
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/HostForMaintenanceFactory.py
@@ -0,0 +1,7 @@
+import factory
+from marvin.integration.lib.newbase import HostForMaintenance
+class HostForMaintenanceFactory(factory.Factory):
+
+    FACTORY_FOR = HostForMaintenance
+
+    id = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/HostMaintenanceFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/HostMaintenanceFactory.py b/tools/marvin/marvin/integration/lib/factory/HostMaintenanceFactory.py
new file mode 100644
index 0000000..d491e00
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/HostMaintenanceFactory.py
@@ -0,0 +1,7 @@
+import factory
+from marvin.integration.lib.newbase import HostMaintenance
+class HostMaintenanceFactory(factory.Factory):
+
+    FACTORY_FOR = HostMaintenance
+
+    id = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/HostPasswordFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/HostPasswordFactory.py b/tools/marvin/marvin/integration/lib/factory/HostPasswordFactory.py
new file mode 100644
index 0000000..316af2b
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/HostPasswordFactory.py
@@ -0,0 +1,8 @@
+import factory
+from marvin.integration.lib.newbase import HostPassword
+class HostPasswordFactory(factory.Factory):
+
+    FACTORY_FOR = HostPassword
+
+    password = None
+    username = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/HypervisorCapabilitiesFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/HypervisorCapabilitiesFactory.py b/tools/marvin/marvin/integration/lib/factory/HypervisorCapabilitiesFactory.py
new file mode 100644
index 0000000..4819a53
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/HypervisorCapabilitiesFactory.py
@@ -0,0 +1,9 @@
+import factory
+from marvin.integration.lib.newbase import HypervisorCapabilities
+class HypervisorCapabilitiesFactory(factory.Factory):
+
+    FACTORY_FOR = HypervisorCapabilities
+
+
+
+    FACTORY_FOR = HypervisorCapabilities

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/HypervisorsFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/HypervisorsFactory.py b/tools/marvin/marvin/integration/lib/factory/HypervisorsFactory.py
new file mode 100644
index 0000000..7b69ccb
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/HypervisorsFactory.py
@@ -0,0 +1,5 @@
+import factory
+from marvin.integration.lib.newbase import Hypervisors
+class HypervisorsFactory(factory.Factory):
+
+    FACTORY_FOR = Hypervisors

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/IsoPermissionsFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/IsoPermissionsFactory.py b/tools/marvin/marvin/integration/lib/factory/IsoPermissionsFactory.py
new file mode 100644
index 0000000..9116ff9
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/IsoPermissionsFactory.py
@@ -0,0 +1,12 @@
+import factory
+from marvin.integration.lib.newbase import IsoPermissions
+class IsoPermissionsFactory(factory.Factory):
+
+    FACTORY_FOR = IsoPermissions
+
+    id = None
+
+
+    FACTORY_FOR = IsoPermissions
+
+    id = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/LBStickinessPoliciesFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/LBStickinessPoliciesFactory.py b/tools/marvin/marvin/integration/lib/factory/LBStickinessPoliciesFactory.py
new file mode 100644
index 0000000..1ed738b
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/LBStickinessPoliciesFactory.py
@@ -0,0 +1,7 @@
+import factory
+from marvin.integration.lib.newbase import LBStickinessPolicies
+class LBStickinessPoliciesFactory(factory.Factory):
+
+    FACTORY_FOR = LBStickinessPolicies
+
+    lbruleid = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/LoadBalancerRuleInstancesFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/LoadBalancerRuleInstancesFactory.py b/tools/marvin/marvin/integration/lib/factory/LoadBalancerRuleInstancesFactory.py
new file mode 100644
index 0000000..f5abf63
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/LoadBalancerRuleInstancesFactory.py
@@ -0,0 +1,7 @@
+import factory
+from marvin.integration.lib.newbase import LoadBalancerRuleInstances
+class LoadBalancerRuleInstancesFactory(factory.Factory):
+
+    FACTORY_FOR = LoadBalancerRuleInstances
+
+    id = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/NetworkDeviceFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/NetworkDeviceFactory.py b/tools/marvin/marvin/integration/lib/factory/NetworkDeviceFactory.py
new file mode 100644
index 0000000..1437e25
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/NetworkDeviceFactory.py
@@ -0,0 +1,15 @@
+import factory
+from marvin.integration.lib.newbase import NetworkDevice
+class NetworkDeviceFactory(factory.Factory):
+
+    FACTORY_FOR = NetworkDevice
+
+
+
+    FACTORY_FOR = NetworkDevice
+
+
+
+    FACTORY_FOR = NetworkDevice
+
+    id = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/NetworkServiceProviderFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/NetworkServiceProviderFactory.py b/tools/marvin/marvin/integration/lib/factory/NetworkServiceProviderFactory.py
new file mode 100644
index 0000000..108af5d
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/NetworkServiceProviderFactory.py
@@ -0,0 +1,22 @@
+import factory
+from marvin.integration.lib.newbase import NetworkServiceProvider
+class NetworkServiceProviderFactory(factory.Factory):
+
+    FACTORY_FOR = NetworkServiceProvider
+
+    name = None
+    physicalnetworkid = None
+
+
+    FACTORY_FOR = NetworkServiceProvider
+
+
+
+    FACTORY_FOR = NetworkServiceProvider
+
+    id = None
+
+
+    FACTORY_FOR = NetworkServiceProvider
+
+    id = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/NiciraNvpDeviceFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/NiciraNvpDeviceFactory.py b/tools/marvin/marvin/integration/lib/factory/NiciraNvpDeviceFactory.py
new file mode 100644
index 0000000..8448c42
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/NiciraNvpDeviceFactory.py
@@ -0,0 +1,20 @@
+import factory
+from marvin.integration.lib.newbase import NiciraNvpDevice
+class NiciraNvpDeviceFactory(factory.Factory):
+
+    FACTORY_FOR = NiciraNvpDevice
+
+    hostname = None
+    password = None
+    physicalnetworkid = None
+    transportzoneuuid = None
+    username = None
+
+
+    FACTORY_FOR = NiciraNvpDevice
+
+
+
+    FACTORY_FOR = NiciraNvpDevice
+
+    nvpdeviceid = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/NiciraNvpDeviceNetworksFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/NiciraNvpDeviceNetworksFactory.py b/tools/marvin/marvin/integration/lib/factory/NiciraNvpDeviceNetworksFactory.py
new file mode 100644
index 0000000..fe7dc70
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/NiciraNvpDeviceNetworksFactory.py
@@ -0,0 +1,7 @@
+import factory
+from marvin.integration.lib.newbase import NiciraNvpDeviceNetworks
+class NiciraNvpDeviceNetworksFactory(factory.Factory):
+
+    FACTORY_FOR = NiciraNvpDeviceNetworks
+
+    nvpdeviceid = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/OsCategoriesFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/OsCategoriesFactory.py b/tools/marvin/marvin/integration/lib/factory/OsCategoriesFactory.py
new file mode 100644
index 0000000..0d60359
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/OsCategoriesFactory.py
@@ -0,0 +1,5 @@
+import factory
+from marvin.integration.lib.newbase import OsCategories
+class OsCategoriesFactory(factory.Factory):
+
+    FACTORY_FOR = OsCategories

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/OsTypesFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/OsTypesFactory.py b/tools/marvin/marvin/integration/lib/factory/OsTypesFactory.py
new file mode 100644
index 0000000..fe105b3
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/OsTypesFactory.py
@@ -0,0 +1,5 @@
+import factory
+from marvin.integration.lib.newbase import OsTypes
+class OsTypesFactory(factory.Factory):
+
+    FACTORY_FOR = OsTypes

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/PasswordForVirtualMachineFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/PasswordForVirtualMachineFactory.py b/tools/marvin/marvin/integration/lib/factory/PasswordForVirtualMachineFactory.py
new file mode 100644
index 0000000..b959226
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/PasswordForVirtualMachineFactory.py
@@ -0,0 +1,7 @@
+import factory
+from marvin.integration.lib.newbase import PasswordForVirtualMachine
+class PasswordForVirtualMachineFactory(factory.Factory):
+
+    FACTORY_FOR = PasswordForVirtualMachine
+
+    id = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/ProjectAccountsFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/ProjectAccountsFactory.py b/tools/marvin/marvin/integration/lib/factory/ProjectAccountsFactory.py
new file mode 100644
index 0000000..e242004
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/ProjectAccountsFactory.py
@@ -0,0 +1,7 @@
+import factory
+from marvin.integration.lib.newbase import ProjectAccounts
+class ProjectAccountsFactory(factory.Factory):
+
+    FACTORY_FOR = ProjectAccounts
+
+    projectid = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/ProjectInvitationFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/ProjectInvitationFactory.py b/tools/marvin/marvin/integration/lib/factory/ProjectInvitationFactory.py
new file mode 100644
index 0000000..762a9d4
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/ProjectInvitationFactory.py
@@ -0,0 +1,16 @@
+import factory
+from marvin.integration.lib.newbase import ProjectInvitation
+class ProjectInvitationFactory(factory.Factory):
+
+    FACTORY_FOR = ProjectInvitation
+
+
+
+    FACTORY_FOR = ProjectInvitation
+
+    projectid = None
+
+
+    FACTORY_FOR = ProjectInvitation
+
+    id = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/PublicIpAddressesFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/PublicIpAddressesFactory.py b/tools/marvin/marvin/integration/lib/factory/PublicIpAddressesFactory.py
new file mode 100644
index 0000000..32e899e
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/PublicIpAddressesFactory.py
@@ -0,0 +1,5 @@
+import factory
+from marvin.integration.lib.newbase import PublicIpAddresses
+class PublicIpAddressesFactory(factory.Factory):
+
+    FACTORY_FOR = PublicIpAddresses

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/RemoveFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/RemoveFactory.py b/tools/marvin/marvin/integration/lib/factory/RemoveFactory.py
new file mode 100644
index 0000000..4cdb94f
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/RemoveFactory.py
@@ -0,0 +1,5 @@
+import factory
+from marvin.integration.lib.newbase import Remove
+class RemoveFactory(factory.Factory):
+
+    FACTORY_FOR = Remove

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/ResourceCountFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/ResourceCountFactory.py b/tools/marvin/marvin/integration/lib/factory/ResourceCountFactory.py
new file mode 100644
index 0000000..7e41d96
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/ResourceCountFactory.py
@@ -0,0 +1,7 @@
+import factory
+from marvin.integration.lib.newbase import ResourceCount
+class ResourceCountFactory(factory.Factory):
+
+    FACTORY_FOR = ResourceCount
+
+    domainid = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/ResourceLimitFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/ResourceLimitFactory.py b/tools/marvin/marvin/integration/lib/factory/ResourceLimitFactory.py
new file mode 100644
index 0000000..9e9f0a0
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/ResourceLimitFactory.py
@@ -0,0 +1,11 @@
+import factory
+from marvin.integration.lib.newbase import ResourceLimit
+class ResourceLimitFactory(factory.Factory):
+
+    FACTORY_FOR = ResourceLimit
+
+
+
+    FACTORY_FOR = ResourceLimit
+
+    resourcetype = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/RouterFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/RouterFactory.py b/tools/marvin/marvin/integration/lib/factory/RouterFactory.py
new file mode 100644
index 0000000..e5d8a6e
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/RouterFactory.py
@@ -0,0 +1,26 @@
+import factory
+from marvin.integration.lib.newbase import Router
+class RouterFactory(factory.Factory):
+
+    FACTORY_FOR = Router
+
+    id = None
+
+
+    FACTORY_FOR = Router
+
+
+
+    FACTORY_FOR = Router
+
+    id = None
+
+
+    FACTORY_FOR = Router
+
+    id = None
+
+
+    FACTORY_FOR = Router
+
+    id = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/S3Factory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/S3Factory.py b/tools/marvin/marvin/integration/lib/factory/S3Factory.py
new file mode 100644
index 0000000..a4942c9
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/S3Factory.py
@@ -0,0 +1,12 @@
+import factory
+from marvin.integration.lib.newbase import S3
+class S3Factory(factory.Factory):
+
+    FACTORY_FOR = S3
+
+    accesskey = None
+    bucket = None
+    secretkey = None
+
+
+    FACTORY_FOR = S3

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/SecondaryStorageFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/SecondaryStorageFactory.py b/tools/marvin/marvin/integration/lib/factory/SecondaryStorageFactory.py
new file mode 100644
index 0000000..b44f1ed
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/SecondaryStorageFactory.py
@@ -0,0 +1,7 @@
+import factory
+from marvin.integration.lib.newbase import SecondaryStorage
+class SecondaryStorageFactory(factory.Factory):
+
+    FACTORY_FOR = SecondaryStorage
+
+    url = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/SecurityGroupEgressFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/SecurityGroupEgressFactory.py b/tools/marvin/marvin/integration/lib/factory/SecurityGroupEgressFactory.py
new file mode 100644
index 0000000..19e715d
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/SecurityGroupEgressFactory.py
@@ -0,0 +1,11 @@
+import factory
+from marvin.integration.lib.newbase import SecurityGroupEgress
+class SecurityGroupEgressFactory(factory.Factory):
+
+    FACTORY_FOR = SecurityGroupEgress
+
+
+
+    FACTORY_FOR = SecurityGroupEgress
+
+    id = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/SecurityGroupIngressFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/SecurityGroupIngressFactory.py b/tools/marvin/marvin/integration/lib/factory/SecurityGroupIngressFactory.py
new file mode 100644
index 0000000..d0f4447
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/SecurityGroupIngressFactory.py
@@ -0,0 +1,11 @@
+import factory
+from marvin.integration.lib.newbase import SecurityGroupIngress
+class SecurityGroupIngressFactory(factory.Factory):
+
+    FACTORY_FOR = SecurityGroupIngress
+
+
+
+    FACTORY_FOR = SecurityGroupIngress
+
+    id = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/ServiceForRouterFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/ServiceForRouterFactory.py b/tools/marvin/marvin/integration/lib/factory/ServiceForRouterFactory.py
new file mode 100644
index 0000000..faa7d7d
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/ServiceForRouterFactory.py
@@ -0,0 +1,8 @@
+import factory
+from marvin.integration.lib.newbase import ServiceForRouter
+class ServiceForRouterFactory(factory.Factory):
+
+    FACTORY_FOR = ServiceForRouter
+
+    id = None
+    serviceofferingid = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/ServiceForSystemVmFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/ServiceForSystemVmFactory.py b/tools/marvin/marvin/integration/lib/factory/ServiceForSystemVmFactory.py
new file mode 100644
index 0000000..42ee081
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/ServiceForSystemVmFactory.py
@@ -0,0 +1,8 @@
+import factory
+from marvin.integration.lib.newbase import ServiceForSystemVm
+class ServiceForSystemVmFactory(factory.Factory):
+
+    FACTORY_FOR = ServiceForSystemVm
+
+    id = None
+    serviceofferingid = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/ServiceForVirtualMachineFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/ServiceForVirtualMachineFactory.py b/tools/marvin/marvin/integration/lib/factory/ServiceForVirtualMachineFactory.py
new file mode 100644
index 0000000..2884594
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/ServiceForVirtualMachineFactory.py
@@ -0,0 +1,8 @@
+import factory
+from marvin.integration.lib.newbase import ServiceForVirtualMachine
+class ServiceForVirtualMachineFactory(factory.Factory):
+
+    FACTORY_FOR = ServiceForVirtualMachine
+
+    id = None
+    serviceofferingid = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/SnapshotPoliciesFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/SnapshotPoliciesFactory.py b/tools/marvin/marvin/integration/lib/factory/SnapshotPoliciesFactory.py
new file mode 100644
index 0000000..bf4cd16
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/SnapshotPoliciesFactory.py
@@ -0,0 +1,10 @@
+import factory
+from marvin.integration.lib.newbase import SnapshotPolicies
+class SnapshotPoliciesFactory(factory.Factory):
+
+    FACTORY_FOR = SnapshotPolicies
+
+    volumeid = None
+
+
+    FACTORY_FOR = SnapshotPolicies

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/StaticNatFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/StaticNatFactory.py b/tools/marvin/marvin/integration/lib/factory/StaticNatFactory.py
new file mode 100644
index 0000000..817fb27
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/StaticNatFactory.py
@@ -0,0 +1,13 @@
+import factory
+from marvin.integration.lib.newbase import StaticNat
+class StaticNatFactory(factory.Factory):
+
+    FACTORY_FOR = StaticNat
+
+    ipaddressid = None
+    virtualmachineid = None
+
+
+    FACTORY_FOR = StaticNat
+
+    ipaddressid = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/StorageMaintenanceFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/StorageMaintenanceFactory.py b/tools/marvin/marvin/integration/lib/factory/StorageMaintenanceFactory.py
new file mode 100644
index 0000000..90335c0
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/StorageMaintenanceFactory.py
@@ -0,0 +1,12 @@
+import factory
+from marvin.integration.lib.newbase import StorageMaintenance
+class StorageMaintenanceFactory(factory.Factory):
+
+    FACTORY_FOR = StorageMaintenance
+
+    id = None
+
+
+    FACTORY_FOR = StorageMaintenance
+
+    id = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/SupportedNetworkServicesFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/SupportedNetworkServicesFactory.py b/tools/marvin/marvin/integration/lib/factory/SupportedNetworkServicesFactory.py
new file mode 100644
index 0000000..d82ab68
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/SupportedNetworkServicesFactory.py
@@ -0,0 +1,5 @@
+import factory
+from marvin.integration.lib.newbase import SupportedNetworkServices
+class SupportedNetworkServicesFactory(factory.Factory):
+
+    FACTORY_FOR = SupportedNetworkServices

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/SwiftFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/SwiftFactory.py b/tools/marvin/marvin/integration/lib/factory/SwiftFactory.py
new file mode 100644
index 0000000..a52da8e
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/SwiftFactory.py
@@ -0,0 +1,10 @@
+import factory
+from marvin.integration.lib.newbase import Swift
+class SwiftFactory(factory.Factory):
+
+    FACTORY_FOR = Swift
+
+    url = None
+
+
+    FACTORY_FOR = Swift

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/SystemVmFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/SystemVmFactory.py b/tools/marvin/marvin/integration/lib/factory/SystemVmFactory.py
new file mode 100644
index 0000000..65c4311
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/SystemVmFactory.py
@@ -0,0 +1,32 @@
+import factory
+from marvin.integration.lib.newbase import SystemVm
+class SystemVmFactory(factory.Factory):
+
+    FACTORY_FOR = SystemVm
+
+    hostid = None
+    virtualmachineid = None
+
+
+    FACTORY_FOR = SystemVm
+
+    id = None
+
+
+    FACTORY_FOR = SystemVm
+
+
+
+    FACTORY_FOR = SystemVm
+
+    id = None
+
+
+    FACTORY_FOR = SystemVm
+
+    id = None
+
+
+    FACTORY_FOR = SystemVm
+
+    id = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/TemplatePermissionsFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/TemplatePermissionsFactory.py b/tools/marvin/marvin/integration/lib/factory/TemplatePermissionsFactory.py
new file mode 100644
index 0000000..88f2493
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/TemplatePermissionsFactory.py
@@ -0,0 +1,12 @@
+import factory
+from marvin.integration.lib.newbase import TemplatePermissions
+class TemplatePermissionsFactory(factory.Factory):
+
+    FACTORY_FOR = TemplatePermissions
+
+    id = None
+
+
+    FACTORY_FOR = TemplatePermissions
+
+    id = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/ToLoadBalancerRuleFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/ToLoadBalancerRuleFactory.py b/tools/marvin/marvin/integration/lib/factory/ToLoadBalancerRuleFactory.py
new file mode 100644
index 0000000..57ad32a
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/ToLoadBalancerRuleFactory.py
@@ -0,0 +1,8 @@
+import factory
+from marvin.integration.lib.newbase import ToLoadBalancerRule
+class ToLoadBalancerRuleFactory(factory.Factory):
+
+    FACTORY_FOR = ToLoadBalancerRule
+
+    id = None
+    virtualmachineids = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/TrafficMonitorFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/TrafficMonitorFactory.py b/tools/marvin/marvin/integration/lib/factory/TrafficMonitorFactory.py
new file mode 100644
index 0000000..cc6db01
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/TrafficMonitorFactory.py
@@ -0,0 +1,18 @@
+import factory
+from marvin.integration.lib.newbase import TrafficMonitor
+class TrafficMonitorFactory(factory.Factory):
+
+    FACTORY_FOR = TrafficMonitor
+
+    url = None
+    zoneid = None
+
+
+    FACTORY_FOR = TrafficMonitor
+
+    zoneid = None
+
+
+    FACTORY_FOR = TrafficMonitor
+
+    id = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/TrafficTypeFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/TrafficTypeFactory.py b/tools/marvin/marvin/integration/lib/factory/TrafficTypeFactory.py
new file mode 100644
index 0000000..78f61a7
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/TrafficTypeFactory.py
@@ -0,0 +1,23 @@
+import factory
+from marvin.integration.lib.newbase import TrafficType
+class TrafficTypeFactory(factory.Factory):
+
+    FACTORY_FOR = TrafficType
+
+    physicalnetworkid = None
+    traffictype = None
+
+
+    FACTORY_FOR = TrafficType
+
+    physicalnetworkid = None
+
+
+    FACTORY_FOR = TrafficType
+
+    id = None
+
+
+    FACTORY_FOR = TrafficType
+
+    id = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/TrafficTypeImplementorsFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/TrafficTypeImplementorsFactory.py b/tools/marvin/marvin/integration/lib/factory/TrafficTypeImplementorsFactory.py
new file mode 100644
index 0000000..3879caf
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/TrafficTypeImplementorsFactory.py
@@ -0,0 +1,5 @@
+import factory
+from marvin.integration.lib.newbase import TrafficTypeImplementors
+class TrafficTypeImplementorsFactory(factory.Factory):
+
+    FACTORY_FOR = TrafficTypeImplementors

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/UsageRecordsFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/UsageRecordsFactory.py b/tools/marvin/marvin/integration/lib/factory/UsageRecordsFactory.py
new file mode 100644
index 0000000..045bdd0
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/UsageRecordsFactory.py
@@ -0,0 +1,14 @@
+import factory
+from marvin.integration.lib.newbase import UsageRecords
+class UsageRecordsFactory(factory.Factory):
+
+    FACTORY_FOR = UsageRecords
+
+    enddate = None
+    startdate = None
+
+
+    FACTORY_FOR = UsageRecords
+
+    enddate = None
+    startdate = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/UsageTypesFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/UsageTypesFactory.py b/tools/marvin/marvin/integration/lib/factory/UsageTypesFactory.py
new file mode 100644
index 0000000..6778df4
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/UsageTypesFactory.py
@@ -0,0 +1,5 @@
+import factory
+from marvin.integration.lib.newbase import UsageTypes
+class UsageTypesFactory(factory.Factory):
+
+    FACTORY_FOR = UsageTypes

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/VMPasswordFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/VMPasswordFactory.py b/tools/marvin/marvin/integration/lib/factory/VMPasswordFactory.py
new file mode 100644
index 0000000..b1cd5bf
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/VMPasswordFactory.py
@@ -0,0 +1,7 @@
+import factory
+from marvin.integration.lib.newbase import VMPassword
+class VMPasswordFactory(factory.Factory):
+
+    FACTORY_FOR = VMPassword
+
+    id = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e80721e/tools/marvin/marvin/integration/lib/factory/VpnUserFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/VpnUserFactory.py b/tools/marvin/marvin/integration/lib/factory/VpnUserFactory.py
new file mode 100644
index 0000000..1dce088
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/VpnUserFactory.py
@@ -0,0 +1,17 @@
+import factory
+from marvin.integration.lib.newbase import VpnUser
+class VpnUserFactory(factory.Factory):
+
+    FACTORY_FOR = VpnUser
+
+    password = None
+    username = None
+
+
+    FACTORY_FOR = VpnUser
+
+
+
+    FACTORY_FOR = VpnUser
+
+    username = None


[03/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
VNS device APIs, VMSnapshot APIs, changes to factory creation

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


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

Branch: refs/heads/marvin_refactor
Commit: 9ebc6f9a296fff15b602ef3f95fac5cff5c0a84d
Parents: dc573f5
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Mon Mar 18 17:56:09 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:00:35 2013 +0530

----------------------------------------------------------------------
 .../marvin/marvin/integration/lib/base/Account.py  |    6 +-
 .../marvin/integration/lib/base/AutoScalePolicy.py |    4 +-
 .../integration/lib/base/AutoScaleVmGroup.py       |    4 +-
 .../integration/lib/base/AutoScaleVmProfile.py     |    4 +-
 .../integration/lib/base/BigSwitchVnsDevice.py     |   49 ++++++++++++
 .../marvin/integration/lib/base/Condition.py       |    4 +-
 .../marvin/marvin/integration/lib/base/Counter.py  |    4 +-
 .../marvin/integration/lib/base/DiskOffering.py    |    4 +-
 tools/marvin/marvin/integration/lib/base/Domain.py |    4 +-
 .../integration/lib/base/EgressFirewallRule.py     |    4 +-
 .../marvin/integration/lib/base/FirewallRule.py    |    4 +-
 .../marvin/integration/lib/base/InstanceGroup.py   |    4 +-
 .../integration/lib/base/IpForwardingRule.py       |    4 +-
 .../marvin/integration/lib/base/IpFromNic.py       |   31 ++++++++
 .../marvin/marvin/integration/lib/base/IpToNic.py  |   31 ++++++++
 .../integration/lib/base/LBStickinessPolicy.py     |    4 +-
 .../integration/lib/base/LoadBalancerRule.py       |    4 +-
 .../marvin/marvin/integration/lib/base/Network.py  |    4 +-
 .../marvin/integration/lib/base/NetworkACL.py      |    4 +-
 .../marvin/integration/lib/base/NetworkOffering.py |    4 +-
 tools/marvin/marvin/integration/lib/base/Nics.py   |   33 ++++++++
 .../marvin/integration/lib/base/PhysicalNetwork.py |    4 +-
 tools/marvin/marvin/integration/lib/base/Pod.py    |    4 +-
 .../integration/lib/base/PortForwardingRule.py     |    4 +-
 .../marvin/integration/lib/base/PrivateGateway.py  |    4 +-
 .../marvin/marvin/integration/lib/base/Project.py  |    4 +-
 tools/marvin/marvin/integration/lib/base/Region.py |   58 +++++++++++++++
 .../marvin/integration/lib/base/RemoteAccessVpn.py |    4 +-
 .../marvin/integration/lib/base/SSHKeyPair.py      |    4 +-
 .../marvin/integration/lib/base/SecurityGroup.py   |    4 +-
 .../marvin/integration/lib/base/ServiceOffering.py |    4 +-
 .../marvin/integration/lib/base/Simulator.py       |   32 ++++++++
 .../marvin/marvin/integration/lib/base/Snapshot.py |    4 +-
 .../marvin/integration/lib/base/SnapshotPolicy.py  |    4 +-
 .../marvin/integration/lib/base/StaticRoute.py     |    4 +-
 .../integration/lib/base/StorageNetworkIpRange.py  |    4 +-
 .../marvin/integration/lib/base/StoragePool.py     |    4 +-
 tools/marvin/marvin/integration/lib/base/Tags.py   |    4 +-
 .../marvin/marvin/integration/lib/base/Template.py |    4 +-
 tools/marvin/marvin/integration/lib/base/User.py   |    4 +-
 .../marvin/integration/lib/base/VMSnapshot.py      |   50 +++++++++++++
 tools/marvin/marvin/integration/lib/base/VPC.py    |    4 +-
 .../marvin/integration/lib/base/VPCOffering.py     |    4 +-
 .../marvin/integration/lib/base/VirtualMachine.py  |    4 +-
 .../integration/lib/base/VirtualRouterElement.py   |    4 +-
 .../marvin/integration/lib/base/VlanIpRange.py     |    4 +-
 tools/marvin/marvin/integration/lib/base/Volume.py |    4 +-
 .../marvin/integration/lib/base/VpnConnection.py   |    4 +-
 .../integration/lib/base/VpnCustomerGateway.py     |    4 +-
 .../marvin/integration/lib/base/VpnGateway.py      |    4 +-
 tools/marvin/marvin/integration/lib/base/Zone.py   |    4 +-
 .../integration/lib/factory/AccountFactory.py      |    3 +-
 .../integration/lib/factory/StoragePoolFactory.py  |    3 +
 .../integration/lib/factory/VMSnapshotFactory.py   |   23 ++++++
 .../integration/lib/factory/test/__init__.py       |   16 ++++
 .../integration/lib/factory/test/testFactories.py  |   33 ++++++++
 .../marvin/marvin/integration/lib/generateBase.py  |    6 +-
 57 files changed, 453 insertions(+), 93 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/Account.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Account.py b/tools/marvin/marvin/integration/lib/base/Account.py
index cef5506..b5ad12a 100644
--- a/tools/marvin/marvin/integration/lib/base/Account.py
+++ b/tools/marvin/marvin/integration/lib/base/Account.py
@@ -23,7 +23,7 @@ from marvin.cloudstackAPI import updateAccount
 from marvin.cloudstackAPI import disableAccount
 from marvin.cloudstackAPI import deleteAccount
 
-class Account(CloudStackEntity.CloudStackEntity):
+class Account(CloudStackEntity):
 
 
     def __init__(self, items):
@@ -47,8 +47,8 @@ class Account(CloudStackEntity.CloudStackEntity):
     @classmethod
     def create(cls, apiclient, AccountFactory, **kwargs):
         cmd = createAccount.createAccountCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in AccountFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in AccountFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         account = apiclient.createAccount(cmd)
         return Account(account.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/AutoScalePolicy.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AutoScalePolicy.py b/tools/marvin/marvin/integration/lib/base/AutoScalePolicy.py
index 4a8b736..5655b48 100644
--- a/tools/marvin/marvin/integration/lib/base/AutoScalePolicy.py
+++ b/tools/marvin/marvin/integration/lib/base/AutoScalePolicy.py
@@ -29,8 +29,8 @@ class AutoScalePolicy(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, AutoScalePolicyFactory, **kwargs):
         cmd = createAutoScalePolicy.createAutoScalePolicyCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in AutoScalePolicyFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in AutoScalePolicyFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         autoscalepolicy = apiclient.createAutoScalePolicy(cmd)
         return AutoScalePolicy(autoscalepolicy.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/AutoScaleVmGroup.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AutoScaleVmGroup.py b/tools/marvin/marvin/integration/lib/base/AutoScaleVmGroup.py
index fdc8147..43aed7a 100644
--- a/tools/marvin/marvin/integration/lib/base/AutoScaleVmGroup.py
+++ b/tools/marvin/marvin/integration/lib/base/AutoScaleVmGroup.py
@@ -39,8 +39,8 @@ class AutoScaleVmGroup(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, AutoScaleVmGroupFactory, **kwargs):
         cmd = createAutoScaleVmGroup.createAutoScaleVmGroupCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in AutoScaleVmGroupFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in AutoScaleVmGroupFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         autoscalevmgroup = apiclient.createAutoScaleVmGroup(cmd)
         return AutoScaleVmGroup(autoscalevmgroup.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/AutoScaleVmProfile.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/AutoScaleVmProfile.py b/tools/marvin/marvin/integration/lib/base/AutoScaleVmProfile.py
index 436b81c..36adbb1 100644
--- a/tools/marvin/marvin/integration/lib/base/AutoScaleVmProfile.py
+++ b/tools/marvin/marvin/integration/lib/base/AutoScaleVmProfile.py
@@ -30,8 +30,8 @@ class AutoScaleVmProfile(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, AutoScaleVmProfileFactory, **kwargs):
         cmd = createAutoScaleVmProfile.createAutoScaleVmProfileCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in AutoScaleVmProfileFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in AutoScaleVmProfileFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         autoscalevmprofile = apiclient.createAutoScaleVmProfile(cmd)
         return AutoScaleVmProfile(autoscalevmprofile.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/BigSwitchVnsDevice.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/BigSwitchVnsDevice.py b/tools/marvin/marvin/integration/lib/base/BigSwitchVnsDevice.py
new file mode 100644
index 0000000..3bccb35
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/base/BigSwitchVnsDevice.py
@@ -0,0 +1,49 @@
+# 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.
+from marvin.integration.lib.base import CloudStackEntity
+from marvin.cloudstackAPI import addBigSwitchVnsDevice
+from marvin.cloudstackAPI import listBigSwitchVnsDevices
+from marvin.cloudstackAPI import deleteBigSwitchVnsDevice
+
+class BigSwitchVnsDevice(CloudStackEntity):
+
+
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
+    def add(self, apiclient, physicalnetworkid, hostname, **kwargs):
+        cmd = addBigSwitchVnsDevice.addBigSwitchVnsDeviceCmd()
+        cmd.hostname = hostname
+        cmd.physicalnetworkid = physicalnetworkid
+        [setattr(cmd, key, value) for key,value in kwargs.items]
+        bigswitchvnsdevice = apiclient.addBigSwitchVnsDevice(cmd)
+
+
+    @classmethod
+    def list(self, apiclient, **kwargs):
+        cmd = listBigSwitchVnsDevices.listBigSwitchVnsDevicesCmd()
+        [setattr(cmd, key, value) for key,value in kwargs.items]
+        bigswitchvnsdevice = apiclient.listBigSwitchVnsDevices(cmd)
+        return map(lambda e: BigSwitchVnsDevice(e.__dict__), bigswitchvnsdevice)
+
+
+    def delete(self, apiclient, vnsdeviceid, **kwargs):
+        cmd = deleteBigSwitchVnsDevice.deleteBigSwitchVnsDeviceCmd()
+        cmd.vnsdeviceid = vnsdeviceid
+        [setattr(cmd, key, value) for key,value in kwargs.items]
+        bigswitchvnsdevice = apiclient.deleteBigSwitchVnsDevice(cmd)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/Condition.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Condition.py b/tools/marvin/marvin/integration/lib/base/Condition.py
index 22d8fc7..5973956 100644
--- a/tools/marvin/marvin/integration/lib/base/Condition.py
+++ b/tools/marvin/marvin/integration/lib/base/Condition.py
@@ -29,8 +29,8 @@ class Condition(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, ConditionFactory, **kwargs):
         cmd = createCondition.createConditionCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in ConditionFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in ConditionFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         condition = apiclient.createCondition(cmd)
         return Condition(condition.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/Counter.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Counter.py b/tools/marvin/marvin/integration/lib/base/Counter.py
index 76a6097..e41ce12 100644
--- a/tools/marvin/marvin/integration/lib/base/Counter.py
+++ b/tools/marvin/marvin/integration/lib/base/Counter.py
@@ -29,8 +29,8 @@ class Counter(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, CounterFactory, **kwargs):
         cmd = createCounter.createCounterCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in CounterFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in CounterFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         counter = apiclient.createCounter(cmd)
         return Counter(counter.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/DiskOffering.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/DiskOffering.py b/tools/marvin/marvin/integration/lib/base/DiskOffering.py
index d20b2b8..a94412a 100644
--- a/tools/marvin/marvin/integration/lib/base/DiskOffering.py
+++ b/tools/marvin/marvin/integration/lib/base/DiskOffering.py
@@ -30,8 +30,8 @@ class DiskOffering(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, DiskOfferingFactory, **kwargs):
         cmd = createDiskOffering.createDiskOfferingCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in DiskOfferingFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in DiskOfferingFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         diskoffering = apiclient.createDiskOffering(cmd)
         return DiskOffering(diskoffering.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/Domain.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Domain.py b/tools/marvin/marvin/integration/lib/base/Domain.py
index feecc38..2d66d2e 100644
--- a/tools/marvin/marvin/integration/lib/base/Domain.py
+++ b/tools/marvin/marvin/integration/lib/base/Domain.py
@@ -30,8 +30,8 @@ class Domain(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, DomainFactory, **kwargs):
         cmd = createDomain.createDomainCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in DomainFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in DomainFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         domain = apiclient.createDomain(cmd)
         return Domain(domain.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/EgressFirewallRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/EgressFirewallRule.py b/tools/marvin/marvin/integration/lib/base/EgressFirewallRule.py
index 5f74351..750ccea 100644
--- a/tools/marvin/marvin/integration/lib/base/EgressFirewallRule.py
+++ b/tools/marvin/marvin/integration/lib/base/EgressFirewallRule.py
@@ -29,8 +29,8 @@ class EgressFirewallRule(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, EgressFirewallRuleFactory, **kwargs):
         cmd = createEgressFirewallRule.createEgressFirewallRuleCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in EgressFirewallRuleFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in EgressFirewallRuleFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         egressfirewallrule = apiclient.createEgressFirewallRule(cmd)
         return EgressFirewallRule(egressfirewallrule.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/FirewallRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/FirewallRule.py b/tools/marvin/marvin/integration/lib/base/FirewallRule.py
index 55f1fd0..2e90907 100644
--- a/tools/marvin/marvin/integration/lib/base/FirewallRule.py
+++ b/tools/marvin/marvin/integration/lib/base/FirewallRule.py
@@ -29,8 +29,8 @@ class FirewallRule(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, FirewallRuleFactory, **kwargs):
         cmd = createFirewallRule.createFirewallRuleCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in FirewallRuleFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in FirewallRuleFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         firewallrule = apiclient.createFirewallRule(cmd)
         return FirewallRule(firewallrule.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/InstanceGroup.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/InstanceGroup.py b/tools/marvin/marvin/integration/lib/base/InstanceGroup.py
index 906d640..852b7f4 100644
--- a/tools/marvin/marvin/integration/lib/base/InstanceGroup.py
+++ b/tools/marvin/marvin/integration/lib/base/InstanceGroup.py
@@ -30,8 +30,8 @@ class InstanceGroup(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, InstanceGroupFactory, **kwargs):
         cmd = createInstanceGroup.createInstanceGroupCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in InstanceGroupFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in InstanceGroupFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         instancegroup = apiclient.createInstanceGroup(cmd)
         return InstanceGroup(instancegroup.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/IpForwardingRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/IpForwardingRule.py b/tools/marvin/marvin/integration/lib/base/IpForwardingRule.py
index 1adc746..0279f15 100644
--- a/tools/marvin/marvin/integration/lib/base/IpForwardingRule.py
+++ b/tools/marvin/marvin/integration/lib/base/IpForwardingRule.py
@@ -29,8 +29,8 @@ class IpForwardingRule(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, IpForwardingRuleFactory, **kwargs):
         cmd = createIpForwardingRule.createIpForwardingRuleCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in IpForwardingRuleFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in IpForwardingRuleFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         ipforwardingrule = apiclient.createIpForwardingRule(cmd)
         return IpForwardingRule(ipforwardingrule.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/IpFromNic.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/IpFromNic.py b/tools/marvin/marvin/integration/lib/base/IpFromNic.py
new file mode 100644
index 0000000..750e142
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/base/IpFromNic.py
@@ -0,0 +1,31 @@
+# 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.
+from marvin.integration.lib.base import CloudStackEntity
+from marvin.cloudstackAPI import removeIpFromNic
+
+class IpFromNic(CloudStackEntity):
+
+
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
+    def remove(self, apiclient, id, **kwargs):
+        cmd = removeIpFromNic.removeIpFromNicCmd()
+        cmd.id = id
+        [setattr(cmd, key, value) for key,value in kwargs.items]
+        ipfromnic = apiclient.removeIpFromNic(cmd)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/IpToNic.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/IpToNic.py b/tools/marvin/marvin/integration/lib/base/IpToNic.py
new file mode 100644
index 0000000..713c07d
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/base/IpToNic.py
@@ -0,0 +1,31 @@
+# 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.
+from marvin.integration.lib.base import CloudStackEntity
+from marvin.cloudstackAPI import addIpToNic
+
+class IpToNic(CloudStackEntity):
+
+
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
+    def add(self, apiclient, nicid, **kwargs):
+        cmd = addIpToNic.addIpToNicCmd()
+        cmd.nicid = nicid
+        [setattr(cmd, key, value) for key,value in kwargs.items]
+        iptonic = apiclient.addIpToNic(cmd)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/LBStickinessPolicy.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/LBStickinessPolicy.py b/tools/marvin/marvin/integration/lib/base/LBStickinessPolicy.py
index 70a8b2f..f5b5613 100644
--- a/tools/marvin/marvin/integration/lib/base/LBStickinessPolicy.py
+++ b/tools/marvin/marvin/integration/lib/base/LBStickinessPolicy.py
@@ -28,8 +28,8 @@ class LBStickinessPolicy(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, LBStickinessPolicyFactory, **kwargs):
         cmd = createLBStickinessPolicy.createLBStickinessPolicyCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in LBStickinessPolicyFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in LBStickinessPolicyFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         lbstickinesspolicy = apiclient.createLBStickinessPolicy(cmd)
         return LBStickinessPolicy(lbstickinesspolicy.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/LoadBalancerRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/LoadBalancerRule.py b/tools/marvin/marvin/integration/lib/base/LoadBalancerRule.py
index 77db0e9..dc2c8ea 100644
--- a/tools/marvin/marvin/integration/lib/base/LoadBalancerRule.py
+++ b/tools/marvin/marvin/integration/lib/base/LoadBalancerRule.py
@@ -30,8 +30,8 @@ class LoadBalancerRule(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, LoadBalancerRuleFactory, **kwargs):
         cmd = createLoadBalancerRule.createLoadBalancerRuleCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in LoadBalancerRuleFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in LoadBalancerRuleFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         loadbalancerrule = apiclient.createLoadBalancerRule(cmd)
         return LoadBalancerRule(loadbalancerrule.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/Network.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Network.py b/tools/marvin/marvin/integration/lib/base/Network.py
index 2a2c43f..1abfbc8 100644
--- a/tools/marvin/marvin/integration/lib/base/Network.py
+++ b/tools/marvin/marvin/integration/lib/base/Network.py
@@ -31,8 +31,8 @@ class Network(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, NetworkFactory, **kwargs):
         cmd = createNetwork.createNetworkCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in NetworkFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in NetworkFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         network = apiclient.createNetwork(cmd)
         return Network(network.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/NetworkACL.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/NetworkACL.py b/tools/marvin/marvin/integration/lib/base/NetworkACL.py
index eafa511..82e0f25 100644
--- a/tools/marvin/marvin/integration/lib/base/NetworkACL.py
+++ b/tools/marvin/marvin/integration/lib/base/NetworkACL.py
@@ -29,8 +29,8 @@ class NetworkACL(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, NetworkACLFactory, **kwargs):
         cmd = createNetworkACL.createNetworkACLCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in NetworkACLFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in NetworkACLFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         networkacl = apiclient.createNetworkACL(cmd)
         return NetworkACL(networkacl.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/NetworkOffering.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/NetworkOffering.py b/tools/marvin/marvin/integration/lib/base/NetworkOffering.py
index 0f27383..41a57d4 100644
--- a/tools/marvin/marvin/integration/lib/base/NetworkOffering.py
+++ b/tools/marvin/marvin/integration/lib/base/NetworkOffering.py
@@ -30,8 +30,8 @@ class NetworkOffering(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, NetworkOfferingFactory, **kwargs):
         cmd = createNetworkOffering.createNetworkOfferingCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in NetworkOfferingFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in NetworkOfferingFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         networkoffering = apiclient.createNetworkOffering(cmd)
         return NetworkOffering(networkoffering.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/Nics.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Nics.py b/tools/marvin/marvin/integration/lib/base/Nics.py
new file mode 100644
index 0000000..57338ce
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/base/Nics.py
@@ -0,0 +1,33 @@
+# 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.
+from marvin.integration.lib.base import CloudStackEntity
+from marvin.cloudstackAPI import listNics
+
+class Nics(CloudStackEntity):
+
+
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
+    @classmethod
+    def list(self, apiclient, virtualmachineid, **kwargs):
+        cmd = listNics.listNicsCmd()
+        cmd.virtualmachineid = virtualmachineid
+        [setattr(cmd, key, value) for key,value in kwargs.items]
+        nics = apiclient.listNics(cmd)
+        return map(lambda e: Nics(e.__dict__), nics)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/PhysicalNetwork.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/PhysicalNetwork.py b/tools/marvin/marvin/integration/lib/base/PhysicalNetwork.py
index 08faa33..69be06b 100644
--- a/tools/marvin/marvin/integration/lib/base/PhysicalNetwork.py
+++ b/tools/marvin/marvin/integration/lib/base/PhysicalNetwork.py
@@ -30,8 +30,8 @@ class PhysicalNetwork(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, PhysicalNetworkFactory, **kwargs):
         cmd = createPhysicalNetwork.createPhysicalNetworkCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in PhysicalNetworkFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in PhysicalNetworkFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         physicalnetwork = apiclient.createPhysicalNetwork(cmd)
         return PhysicalNetwork(physicalnetwork.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/Pod.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Pod.py b/tools/marvin/marvin/integration/lib/base/Pod.py
index 3c57d09..d3d822f 100644
--- a/tools/marvin/marvin/integration/lib/base/Pod.py
+++ b/tools/marvin/marvin/integration/lib/base/Pod.py
@@ -30,8 +30,8 @@ class Pod(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, PodFactory, **kwargs):
         cmd = createPod.createPodCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in PodFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in PodFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         pod = apiclient.createPod(cmd)
         return Pod(pod.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/PortForwardingRule.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/PortForwardingRule.py b/tools/marvin/marvin/integration/lib/base/PortForwardingRule.py
index ad32244..5d69a1a 100644
--- a/tools/marvin/marvin/integration/lib/base/PortForwardingRule.py
+++ b/tools/marvin/marvin/integration/lib/base/PortForwardingRule.py
@@ -30,8 +30,8 @@ class PortForwardingRule(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, PortForwardingRuleFactory, **kwargs):
         cmd = createPortForwardingRule.createPortForwardingRuleCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in PortForwardingRuleFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in PortForwardingRuleFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         portforwardingrule = apiclient.createPortForwardingRule(cmd)
         return PortForwardingRule(portforwardingrule.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/PrivateGateway.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/PrivateGateway.py b/tools/marvin/marvin/integration/lib/base/PrivateGateway.py
index 543dc73..c121cc0 100644
--- a/tools/marvin/marvin/integration/lib/base/PrivateGateway.py
+++ b/tools/marvin/marvin/integration/lib/base/PrivateGateway.py
@@ -29,8 +29,8 @@ class PrivateGateway(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, PrivateGatewayFactory, **kwargs):
         cmd = createPrivateGateway.createPrivateGatewayCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in PrivateGatewayFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in PrivateGatewayFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         privategateway = apiclient.createPrivateGateway(cmd)
         return PrivateGateway(privategateway.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/Project.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Project.py b/tools/marvin/marvin/integration/lib/base/Project.py
index ce3ca29..8ca176e 100644
--- a/tools/marvin/marvin/integration/lib/base/Project.py
+++ b/tools/marvin/marvin/integration/lib/base/Project.py
@@ -39,8 +39,8 @@ class Project(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, ProjectFactory, **kwargs):
         cmd = createProject.createProjectCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in ProjectFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in ProjectFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         project = apiclient.createProject(cmd)
         return Project(project.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/Region.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Region.py b/tools/marvin/marvin/integration/lib/base/Region.py
new file mode 100644
index 0000000..03631ab
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/base/Region.py
@@ -0,0 +1,58 @@
+# 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.
+from marvin.integration.lib.base import CloudStackEntity
+from marvin.cloudstackAPI import addRegion
+from marvin.cloudstackAPI import listRegions
+from marvin.cloudstackAPI import updateRegion
+from marvin.cloudstackAPI import removeRegion
+
+class Region(CloudStackEntity):
+
+
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
+    def add(self, apiclient, endpoint, id, name, **kwargs):
+        cmd = addRegion.addRegionCmd()
+        cmd.id = id
+        cmd.endpoint = endpoint
+        cmd.name = name
+        [setattr(cmd, key, value) for key,value in kwargs.items]
+        region = apiclient.addRegion(cmd)
+
+
+    @classmethod
+    def list(self, apiclient, **kwargs):
+        cmd = listRegions.listRegionsCmd()
+        [setattr(cmd, key, value) for key,value in kwargs.items]
+        region = apiclient.listRegions(cmd)
+        return map(lambda e: Region(e.__dict__), region)
+
+
+    def update(self, apiclient, id, **kwargs):
+        cmd = updateRegion.updateRegionCmd()
+        cmd.id = id
+        [setattr(cmd, key, value) for key,value in kwargs.items]
+        region = apiclient.updateRegion(cmd)
+
+
+    def remove(self, apiclient, id, **kwargs):
+        cmd = removeRegion.removeRegionCmd()
+        cmd.id = id
+        [setattr(cmd, key, value) for key,value in kwargs.items]
+        region = apiclient.removeRegion(cmd)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/RemoteAccessVpn.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/RemoteAccessVpn.py b/tools/marvin/marvin/integration/lib/base/RemoteAccessVpn.py
index 7eb1871..047559f 100644
--- a/tools/marvin/marvin/integration/lib/base/RemoteAccessVpn.py
+++ b/tools/marvin/marvin/integration/lib/base/RemoteAccessVpn.py
@@ -29,8 +29,8 @@ class RemoteAccessVpn(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, RemoteAccessVpnFactory, **kwargs):
         cmd = createRemoteAccessVpn.createRemoteAccessVpnCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in RemoteAccessVpnFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in RemoteAccessVpnFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         remoteaccessvpn = apiclient.createRemoteAccessVpn(cmd)
         return RemoteAccessVpn(remoteaccessvpn.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/SSHKeyPair.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SSHKeyPair.py b/tools/marvin/marvin/integration/lib/base/SSHKeyPair.py
index ed1dd4a..88859d5 100644
--- a/tools/marvin/marvin/integration/lib/base/SSHKeyPair.py
+++ b/tools/marvin/marvin/integration/lib/base/SSHKeyPair.py
@@ -30,8 +30,8 @@ class SSHKeyPair(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, SSHKeyPairFactory, **kwargs):
         cmd = createSSHKeyPair.createSSHKeyPairCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in SSHKeyPairFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in SSHKeyPairFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         sshkeypair = apiclient.createSSHKeyPair(cmd)
         return SSHKeyPair(sshkeypair.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/SecurityGroup.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SecurityGroup.py b/tools/marvin/marvin/integration/lib/base/SecurityGroup.py
index 204f778..9103538 100644
--- a/tools/marvin/marvin/integration/lib/base/SecurityGroup.py
+++ b/tools/marvin/marvin/integration/lib/base/SecurityGroup.py
@@ -29,8 +29,8 @@ class SecurityGroup(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, SecurityGroupFactory, **kwargs):
         cmd = createSecurityGroup.createSecurityGroupCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in SecurityGroupFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in SecurityGroupFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         securitygroup = apiclient.createSecurityGroup(cmd)
         return SecurityGroup(securitygroup.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/ServiceOffering.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/ServiceOffering.py b/tools/marvin/marvin/integration/lib/base/ServiceOffering.py
index 088b27a..8e8174c 100644
--- a/tools/marvin/marvin/integration/lib/base/ServiceOffering.py
+++ b/tools/marvin/marvin/integration/lib/base/ServiceOffering.py
@@ -30,8 +30,8 @@ class ServiceOffering(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, ServiceOfferingFactory, **kwargs):
         cmd = createServiceOffering.createServiceOfferingCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in ServiceOfferingFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in ServiceOfferingFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         serviceoffering = apiclient.createServiceOffering(cmd)
         return ServiceOffering(serviceoffering.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/Simulator.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Simulator.py b/tools/marvin/marvin/integration/lib/base/Simulator.py
new file mode 100644
index 0000000..5c58dde
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/base/Simulator.py
@@ -0,0 +1,32 @@
+# 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.
+from marvin.integration.lib.base import CloudStackEntity
+from marvin.cloudstackAPI import configureSimulator
+
+class Simulator(CloudStackEntity):
+
+
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
+    def configure(self, apiclient, name, value, **kwargs):
+        cmd = configureSimulator.configureSimulatorCmd()
+        cmd.name = name
+        cmd.value = value
+        [setattr(cmd, key, value) for key,value in kwargs.items]
+        simulator = apiclient.configureSimulator(cmd)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/Snapshot.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Snapshot.py b/tools/marvin/marvin/integration/lib/base/Snapshot.py
index ab4eebd..989e7fb 100644
--- a/tools/marvin/marvin/integration/lib/base/Snapshot.py
+++ b/tools/marvin/marvin/integration/lib/base/Snapshot.py
@@ -29,8 +29,8 @@ class Snapshot(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, SnapshotFactory, **kwargs):
         cmd = createSnapshot.createSnapshotCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in SnapshotFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in SnapshotFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         snapshot = apiclient.createSnapshot(cmd)
         return Snapshot(snapshot.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/SnapshotPolicy.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/SnapshotPolicy.py b/tools/marvin/marvin/integration/lib/base/SnapshotPolicy.py
index 2ce10e4..18394b1 100644
--- a/tools/marvin/marvin/integration/lib/base/SnapshotPolicy.py
+++ b/tools/marvin/marvin/integration/lib/base/SnapshotPolicy.py
@@ -27,8 +27,8 @@ class SnapshotPolicy(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, SnapshotPolicyFactory, **kwargs):
         cmd = createSnapshotPolicy.createSnapshotPolicyCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in SnapshotPolicyFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in SnapshotPolicyFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         snapshotpolicy = apiclient.createSnapshotPolicy(cmd)
         return SnapshotPolicy(snapshotpolicy.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/StaticRoute.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/StaticRoute.py b/tools/marvin/marvin/integration/lib/base/StaticRoute.py
index 10830bd..f96a4dc 100644
--- a/tools/marvin/marvin/integration/lib/base/StaticRoute.py
+++ b/tools/marvin/marvin/integration/lib/base/StaticRoute.py
@@ -29,8 +29,8 @@ class StaticRoute(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, StaticRouteFactory, **kwargs):
         cmd = createStaticRoute.createStaticRouteCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in StaticRouteFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in StaticRouteFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         staticroute = apiclient.createStaticRoute(cmd)
         return StaticRoute(staticroute.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/StorageNetworkIpRange.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/StorageNetworkIpRange.py b/tools/marvin/marvin/integration/lib/base/StorageNetworkIpRange.py
index 220f8c6..2bc6b5b 100644
--- a/tools/marvin/marvin/integration/lib/base/StorageNetworkIpRange.py
+++ b/tools/marvin/marvin/integration/lib/base/StorageNetworkIpRange.py
@@ -30,8 +30,8 @@ class StorageNetworkIpRange(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, StorageNetworkIpRangeFactory, **kwargs):
         cmd = createStorageNetworkIpRange.createStorageNetworkIpRangeCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in StorageNetworkIpRangeFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in StorageNetworkIpRangeFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         storagenetworkiprange = apiclient.createStorageNetworkIpRange(cmd)
         return StorageNetworkIpRange(storagenetworkiprange.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/StoragePool.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/StoragePool.py b/tools/marvin/marvin/integration/lib/base/StoragePool.py
index 3dc8bcb..d15de83 100644
--- a/tools/marvin/marvin/integration/lib/base/StoragePool.py
+++ b/tools/marvin/marvin/integration/lib/base/StoragePool.py
@@ -30,8 +30,8 @@ class StoragePool(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, StoragePoolFactory, **kwargs):
         cmd = createStoragePool.createStoragePoolCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in StoragePoolFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in StoragePoolFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         storagepool = apiclient.createStoragePool(cmd)
         return StoragePool(storagepool.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/Tags.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Tags.py b/tools/marvin/marvin/integration/lib/base/Tags.py
index 9bf22fb..e46742b 100644
--- a/tools/marvin/marvin/integration/lib/base/Tags.py
+++ b/tools/marvin/marvin/integration/lib/base/Tags.py
@@ -29,8 +29,8 @@ class Tags(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, TagsFactory, **kwargs):
         cmd = createTags.createTagsCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in TagsFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in TagsFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         tags = apiclient.createTags(cmd)
         return Tags(tags.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/Template.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Template.py b/tools/marvin/marvin/integration/lib/base/Template.py
index 559e1f2..1f62158 100644
--- a/tools/marvin/marvin/integration/lib/base/Template.py
+++ b/tools/marvin/marvin/integration/lib/base/Template.py
@@ -42,8 +42,8 @@ class Template(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, TemplateFactory, **kwargs):
         cmd = createTemplate.createTemplateCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in TemplateFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in TemplateFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         template = apiclient.createTemplate(cmd)
         return Template(template.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/User.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/User.py b/tools/marvin/marvin/integration/lib/base/User.py
index a89969b..37097bf 100644
--- a/tools/marvin/marvin/integration/lib/base/User.py
+++ b/tools/marvin/marvin/integration/lib/base/User.py
@@ -55,8 +55,8 @@ class User(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, UserFactory, **kwargs):
         cmd = createUser.createUserCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in UserFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in UserFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         user = apiclient.createUser(cmd)
         return User(user.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/VMSnapshot.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VMSnapshot.py b/tools/marvin/marvin/integration/lib/base/VMSnapshot.py
new file mode 100644
index 0000000..66a1707
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/base/VMSnapshot.py
@@ -0,0 +1,50 @@
+# 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.
+from marvin.integration.lib.base import CloudStackEntity
+from marvin.cloudstackAPI import createVMSnapshot
+from marvin.cloudstackAPI import listVMSnapshot
+from marvin.cloudstackAPI import deleteVMSnapshot
+
+class VMSnapshot(CloudStackEntity):
+
+
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+
+    @classmethod
+    def create(cls, apiclient, VMSnapshotFactory, **kwargs):
+        cmd = createVMSnapshot.createVMSnapshotCmd()
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in VMSnapshotFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        vmsnapshot = apiclient.createVMSnapshot(cmd)
+        return VMSnapshot(vmsnapshot.__dict__)
+
+
+    @classmethod
+    def list(self, apiclient, **kwargs):
+        cmd = listVMSnapshot.listVMSnapshotCmd()
+        [setattr(cmd, key, value) for key,value in kwargs.items]
+        vmsnapshot = apiclient.listVMSnapshot(cmd)
+        return map(lambda e: VMSnapshot(e.__dict__), vmsnapshot)
+
+
+    def delete(self, apiclient, vmsnapshotid, **kwargs):
+        cmd = deleteVMSnapshot.deleteVMSnapshotCmd()
+        cmd.vmsnapshotid = vmsnapshotid
+        [setattr(cmd, key, value) for key,value in kwargs.items]
+        vmsnapshot = apiclient.deleteVMSnapshot(cmd)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/VPC.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VPC.py b/tools/marvin/marvin/integration/lib/base/VPC.py
index 4e1b59a..6e48ce3 100644
--- a/tools/marvin/marvin/integration/lib/base/VPC.py
+++ b/tools/marvin/marvin/integration/lib/base/VPC.py
@@ -31,8 +31,8 @@ class VPC(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, VPCFactory, **kwargs):
         cmd = createVPC.createVPCCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in VPCFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in VPCFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpc = apiclient.createVPC(cmd)
         return VPC(vpc.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/VPCOffering.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VPCOffering.py b/tools/marvin/marvin/integration/lib/base/VPCOffering.py
index 557b94e..c6d2bab 100644
--- a/tools/marvin/marvin/integration/lib/base/VPCOffering.py
+++ b/tools/marvin/marvin/integration/lib/base/VPCOffering.py
@@ -30,8 +30,8 @@ class VPCOffering(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, VPCOfferingFactory, **kwargs):
         cmd = createVPCOffering.createVPCOfferingCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in VPCOfferingFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in VPCOfferingFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpcoffering = apiclient.createVPCOffering(cmd)
         return VPCOffering(vpcoffering.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/VirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VirtualMachine.py b/tools/marvin/marvin/integration/lib/base/VirtualMachine.py
index 804729e..c788f0c 100644
--- a/tools/marvin/marvin/integration/lib/base/VirtualMachine.py
+++ b/tools/marvin/marvin/integration/lib/base/VirtualMachine.py
@@ -43,8 +43,8 @@ class VirtualMachine(CloudStackEntity):
     @classmethod
     def deploy(cls, apiclient, VirtualMachineFactory, **kwargs):
         cmd = deployVirtualMachine.deployVirtualMachineCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in VirtualMachineFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in VirtualMachineFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         virtualmachine = apiclient.deployVirtualMachine(cmd)
         return VirtualMachine(virtualmachine.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/VirtualRouterElement.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VirtualRouterElement.py b/tools/marvin/marvin/integration/lib/base/VirtualRouterElement.py
index 45b77db..246162c 100644
--- a/tools/marvin/marvin/integration/lib/base/VirtualRouterElement.py
+++ b/tools/marvin/marvin/integration/lib/base/VirtualRouterElement.py
@@ -29,8 +29,8 @@ class VirtualRouterElement(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, VirtualRouterElementFactory, **kwargs):
         cmd = createVirtualRouterElement.createVirtualRouterElementCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in VirtualRouterElementFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in VirtualRouterElementFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         virtualrouterelement = apiclient.createVirtualRouterElement(cmd)
         return VirtualRouterElement(virtualrouterelement.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/VlanIpRange.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VlanIpRange.py b/tools/marvin/marvin/integration/lib/base/VlanIpRange.py
index 17eb7da..db1e4f0 100644
--- a/tools/marvin/marvin/integration/lib/base/VlanIpRange.py
+++ b/tools/marvin/marvin/integration/lib/base/VlanIpRange.py
@@ -29,8 +29,8 @@ class VlanIpRange(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, VlanIpRangeFactory, **kwargs):
         cmd = createVlanIpRange.createVlanIpRangeCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in VlanIpRangeFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in VlanIpRangeFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vlaniprange = apiclient.createVlanIpRange(cmd)
         return VlanIpRange(vlaniprange.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/Volume.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Volume.py b/tools/marvin/marvin/integration/lib/base/Volume.py
index 797113a..8c421c9 100644
--- a/tools/marvin/marvin/integration/lib/base/Volume.py
+++ b/tools/marvin/marvin/integration/lib/base/Volume.py
@@ -42,8 +42,8 @@ class Volume(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, VolumeFactory, **kwargs):
         cmd = createVolume.createVolumeCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in VolumeFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in VolumeFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         volume = apiclient.createVolume(cmd)
         return Volume(volume.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/VpnConnection.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VpnConnection.py b/tools/marvin/marvin/integration/lib/base/VpnConnection.py
index 8b90ae1..d76e5de 100644
--- a/tools/marvin/marvin/integration/lib/base/VpnConnection.py
+++ b/tools/marvin/marvin/integration/lib/base/VpnConnection.py
@@ -37,8 +37,8 @@ class VpnConnection(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, VpnConnectionFactory, **kwargs):
         cmd = createVpnConnection.createVpnConnectionCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in VpnConnectionFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in VpnConnectionFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpnconnection = apiclient.createVpnConnection(cmd)
         return VpnConnection(vpnconnection.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/VpnCustomerGateway.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VpnCustomerGateway.py b/tools/marvin/marvin/integration/lib/base/VpnCustomerGateway.py
index 562fccb..c57054b 100644
--- a/tools/marvin/marvin/integration/lib/base/VpnCustomerGateway.py
+++ b/tools/marvin/marvin/integration/lib/base/VpnCustomerGateway.py
@@ -30,8 +30,8 @@ class VpnCustomerGateway(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, VpnCustomerGatewayFactory, **kwargs):
         cmd = createVpnCustomerGateway.createVpnCustomerGatewayCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in VpnCustomerGatewayFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in VpnCustomerGatewayFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpncustomergateway = apiclient.createVpnCustomerGateway(cmd)
         return VpnCustomerGateway(vpncustomergateway.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/VpnGateway.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VpnGateway.py b/tools/marvin/marvin/integration/lib/base/VpnGateway.py
index d5cd0df..f39e7a7 100644
--- a/tools/marvin/marvin/integration/lib/base/VpnGateway.py
+++ b/tools/marvin/marvin/integration/lib/base/VpnGateway.py
@@ -29,8 +29,8 @@ class VpnGateway(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, VpnGatewayFactory, **kwargs):
         cmd = createVpnGateway.createVpnGatewayCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in VpnGatewayFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in VpnGatewayFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpngateway = apiclient.createVpnGateway(cmd)
         return VpnGateway(vpngateway.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/base/Zone.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Zone.py b/tools/marvin/marvin/integration/lib/base/Zone.py
index f84e454..feac7c6 100644
--- a/tools/marvin/marvin/integration/lib/base/Zone.py
+++ b/tools/marvin/marvin/integration/lib/base/Zone.py
@@ -30,8 +30,8 @@ class Zone(CloudStackEntity):
     @classmethod
     def create(cls, apiclient, ZoneFactory, **kwargs):
         cmd = createZone.createZoneCmd()
-        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in ZoneFactory.attributes()]
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in ZoneFactory.__dict__.iteritems()]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         zone = apiclient.createZone(cmd)
         return Zone(zone.__dict__)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/factory/AccountFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/AccountFactory.py b/tools/marvin/marvin/integration/lib/factory/AccountFactory.py
index 894f92e..dc543d4 100644
--- a/tools/marvin/marvin/integration/lib/factory/AccountFactory.py
+++ b/tools/marvin/marvin/integration/lib/factory/AccountFactory.py
@@ -28,13 +28,14 @@ class AccountFactory(CloudStackBaseFactory):
     email = factory.LazyAttribute(lambda e: '{0}.{1}@cloudstack.org'.format(e.firstname, e.lastname).lower())
     firstname = 'fname-'+random_gen()
     lastname = 'lname-'+random_gen()
-    username = None
+    username = firstname + lastname
 
     # Password Encoding
     mdf = hashlib.md5()
     mdf.update('password')
     password = mdf.hexdigest()
 
+
 class AdminAccountFactory(AccountFactory):
     accounttype = 1
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/factory/StoragePoolFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/StoragePoolFactory.py b/tools/marvin/marvin/integration/lib/factory/StoragePoolFactory.py
index 3803bfc..775375d 100644
--- a/tools/marvin/marvin/integration/lib/factory/StoragePoolFactory.py
+++ b/tools/marvin/marvin/integration/lib/factory/StoragePoolFactory.py
@@ -25,3 +25,6 @@ class StoragePoolFactory(factory.Factory):
     podid = None
     url = None
     zoneid = None
+    name = None
+    url = None
+    zoneid = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/factory/VMSnapshotFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/VMSnapshotFactory.py b/tools/marvin/marvin/integration/lib/factory/VMSnapshotFactory.py
new file mode 100644
index 0000000..bbd0bd7
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/VMSnapshotFactory.py
@@ -0,0 +1,23 @@
+# 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.
+import factory
+from marvin.integration.lib.base import VMSnapshot
+class VMSnapshotFactory(factory.Factory):
+
+    FACTORY_FOR = VMSnapshot.VMSnapshot
+
+    virtualmachineid = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/factory/test/__init__.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/test/__init__.py b/tools/marvin/marvin/integration/lib/factory/test/__init__.py
new file mode 100644
index 0000000..d216be4
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/test/__init__.py
@@ -0,0 +1,16 @@
+# 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.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/test/testFactories.py b/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
new file mode 100644
index 0000000..eec44de
--- /dev/null
+++ b/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
@@ -0,0 +1,33 @@
+# 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.
+
+import unittest
+from marvin.integration.lib.factory import AccountFactory
+from marvin.integration.lib.base import Account
+from marvin.cloudstackTestClient import cloudstackTestClient
+
+class AccountFactoryTest(unittest.TestCase):
+    def setUp(self):
+        self.apiClient = cloudstackTestClient(mgtSvr='localhost')
+
+    def test_userAccountFactory(self):
+        af = AccountFactory.AdminAccountFactory()
+        accnt = Account.Account.create(apiclient=self.apiClient, AccountFactory=af)
+        self.assertTrue(accnt is not None, msg="no account created by factory")
+
+    def tearDown(self):
+        self.apiClient.close()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ebc6f9a/tools/marvin/marvin/integration/lib/generateBase.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/generateBase.py b/tools/marvin/marvin/integration/lib/generateBase.py
index 5f5e3df..f94043e 100644
--- a/tools/marvin/marvin/integration/lib/generateBase.py
+++ b/tools/marvin/marvin/integration/lib/generateBase.py
@@ -126,8 +126,8 @@ def write_entity_classes(entities):
             if action in ['create', 'deploy']:
                 body.append(tabspace + 'def %s(cls, apiclient, %sFactory, **kwargs):'%(action, entity))
                 body.append(tabspace*2 + 'cmd = %(module)s.%(command)s()'%{"module": details["apimodule"], "command": details["apicmd"]})
-                body.append(tabspace*2 + '[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in %sFactory.attributes()]'%entity)
-                body.append(tabspace*2 + '[setattr(cmd, key, value) for key,value in kwargs.items]')
+                body.append(tabspace*2 + '[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in %sFactory.__dict__.iteritems()]'%entity)
+                body.append(tabspace*2 + '[setattr(cmd, key, value) for key,value in kwargs.iteritems()]')
                 body.append(tabspace*2 + '%s = apiclient.%s(cmd)'%(entity.lower(), details['apimodule']))
                 body.append(tabspace*2 + 'return %s(%s.__dict__)'%(entity, entity.lower()))
             else:
@@ -185,7 +185,7 @@ def write_entity_factory(entity, actions):
         code += 'from marvin.integration.lib.base import %s\n'%entity
         code += 'class %sFactory(factory.Factory):'%entity
         code += '\n\n'
-        code += tabspace + 'FACTORY_FOR = %s\n\n'%entity
+        code += tabspace + 'FACTORY_FOR = %s.%s\n\n'%(entity,entity)
         for arg in factory_defaults:
             code += tabspace + '%s = None\n'%arg
         with open("./factory/%sFactory.py"%entity, "w") as writer:


[32/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
Fix a bug for listZones and listServiceOfferings for normal user, caused
by a misuse of SearchCriteria class.


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

Branch: refs/heads/marvin_refactor
Commit: 313ac21af5dd0bf0909c8af7e9da2ee9172fca3f
Parents: 7e80721
Author: Min Chen <mi...@citrix.com>
Authored: Wed Jan 23 10:16:17 2013 -0800
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:19:14 2013 +0530

----------------------------------------------------------------------
 .../src/com/cloud/api/query/QueryManagerImpl.java  |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/313ac21a/server/src/com/cloud/api/query/QueryManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java
index 951d09e..63c6b32 100644
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@ -2105,7 +2105,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
                 domainRecord = _domainDao.findById(domainRecord.getParent());
                 domainIds.add(domainRecord.getId());
             }
-            sc.addAnd("domainId", SearchCriteria.Op.IN, domainIds.toArray());
+            sc.addAnd("domainId", SearchCriteria.Op.IN, domainIds);
 
             // include also public offering if no keyword, name and id specified
             if ( keyword == null && name == null && id == null ){
@@ -2238,7 +2238,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
                 }
                 // domainId == null (public zones) or domainId IN [all domain id up to root domain]
                 SearchCriteria<DataCenterJoinVO> sdc = _dcJoinDao.createSearchCriteria();
-                sdc.addOr("domainId", SearchCriteria.Op.IN, domainIds.toArray());
+                sdc.addOr("domainId", SearchCriteria.Op.IN, domainIds);
                 sdc.addOr("domainId", SearchCriteria.Op.NULL);
                 sc.addAnd("domain", SearchCriteria.Op.SC, sdc);
 
@@ -2268,7 +2268,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
 
                 // domainId == null (public zones) or domainId IN [all domain id up to root domain]
                 SearchCriteria<DataCenterJoinVO> sdc = _dcJoinDao.createSearchCriteria();
-                sdc.addOr("domainId", SearchCriteria.Op.IN, domainIds.toArray());
+                sdc.addOr("domainId", SearchCriteria.Op.IN, domainIds);
                 sdc.addOr("domainId", SearchCriteria.Op.NULL);
                 sc.addAnd("domain", SearchCriteria.Op.SC, sdc);
 


[41/50] [abbrv] actions on entity object require id for performing the action

Posted by ts...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/User.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/User.py b/tools/marvin/marvin/integration/lib/base/User.py
index bc84761..c0bad62 100644
--- a/tools/marvin/marvin/integration/lib/base/User.py
+++ b/tools/marvin/marvin/integration/lib/base/User.py
@@ -33,23 +33,29 @@ class User(CloudStackEntity.CloudStackEntity):
 
     def enable(self, apiclient, id, **kwargs):
         cmd = enableUser.enableUserCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         user = apiclient.enableUser(cmd)
+        return user
 
 
     def get(self, apiclient, userapikey, **kwargs):
         cmd = getUser.getUserCmd()
+        cmd.id = self.id
         cmd.userapikey = userapikey
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         user = apiclient.getUser(cmd)
+        return user
 
 
     def lock(self, apiclient, id, **kwargs):
         cmd = lockUser.lockUserCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         user = apiclient.lockUser(cmd)
+        return user
 
 
     @classmethod
@@ -64,28 +70,34 @@ class User(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listUsers.listUsersCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         user = apiclient.listUsers(cmd)
         return map(lambda e: User(e.__dict__), user)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateUser.updateUserCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         user = apiclient.updateUser(cmd)
+        return user
 
 
     def disable(self, apiclient, id, **kwargs):
         cmd = disableUser.disableUserCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         user = apiclient.disableUser(cmd)
+        return user
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteUser.deleteUserCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         user = apiclient.deleteUser(cmd)
+        return user
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/UserKeys.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/UserKeys.py b/tools/marvin/marvin/integration/lib/base/UserKeys.py
index 429062b..a42b65b 100644
--- a/tools/marvin/marvin/integration/lib/base/UserKeys.py
+++ b/tools/marvin/marvin/integration/lib/base/UserKeys.py
@@ -24,13 +24,11 @@ class UserKeys(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def register(self, apiclient, id, **kwargs):
         cmd = registerUserKeys.registerUserKeysCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         userkeys = apiclient.registerUserKeys(cmd)
+        return userkeys
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/VMPassword.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VMPassword.py b/tools/marvin/marvin/integration/lib/base/VMPassword.py
index 7cc271d..c938d31 100644
--- a/tools/marvin/marvin/integration/lib/base/VMPassword.py
+++ b/tools/marvin/marvin/integration/lib/base/VMPassword.py
@@ -24,13 +24,11 @@ class VMPassword(CloudStackEntity.CloudStackEntity):
         self.__dict__.update(items)
 
 
-    def __init__(self, items):
-        self.__dict__.update(items)
-
-
     def get(self, apiclient, id, **kwargs):
         cmd = getVMPassword.getVMPasswordCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vmpassword = apiclient.getVMPassword(cmd)
+        return vmpassword
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/VMSnapshot.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VMSnapshot.py b/tools/marvin/marvin/integration/lib/base/VMSnapshot.py
index ccc915b..e7f2e9a 100644
--- a/tools/marvin/marvin/integration/lib/base/VMSnapshot.py
+++ b/tools/marvin/marvin/integration/lib/base/VMSnapshot.py
@@ -38,13 +38,16 @@ class VMSnapshot(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listVMSnapshot.listVMSnapshotCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vmsnapshot = apiclient.listVMSnapshot(cmd)
         return map(lambda e: VMSnapshot(e.__dict__), vmsnapshot)
 
 
     def delete(self, apiclient, vmsnapshotid, **kwargs):
         cmd = deleteVMSnapshot.deleteVMSnapshotCmd()
+        cmd.id = self.id
         cmd.vmsnapshotid = vmsnapshotid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vmsnapshot = apiclient.deleteVMSnapshot(cmd)
+        return vmsnapshot
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/VPC.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VPC.py b/tools/marvin/marvin/integration/lib/base/VPC.py
index 770a737..43c22ba 100644
--- a/tools/marvin/marvin/integration/lib/base/VPC.py
+++ b/tools/marvin/marvin/integration/lib/base/VPC.py
@@ -40,26 +40,32 @@ class VPC(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listVPCs.listVPCsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpc = apiclient.listVPCs(cmd)
         return map(lambda e: VPC(e.__dict__), vpc)
 
 
     def update(self, apiclient, **kwargs):
         cmd = updateVPC.updateVPCCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpc = apiclient.updateVPC(cmd)
+        return vpc
 
 
     def restart(self, apiclient, **kwargs):
         cmd = restartVPC.restartVPCCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpc = apiclient.restartVPC(cmd)
+        return vpc
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteVPC.deleteVPCCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpc = apiclient.deleteVPC(cmd)
+        return vpc
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/VPCOffering.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VPCOffering.py b/tools/marvin/marvin/integration/lib/base/VPCOffering.py
index 71557f7..1197dcc 100644
--- a/tools/marvin/marvin/integration/lib/base/VPCOffering.py
+++ b/tools/marvin/marvin/integration/lib/base/VPCOffering.py
@@ -39,20 +39,24 @@ class VPCOffering(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listVPCOfferings.listVPCOfferingsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpcoffering = apiclient.listVPCOfferings(cmd)
         return map(lambda e: VPCOffering(e.__dict__), vpcoffering)
 
 
     def update(self, apiclient, **kwargs):
         cmd = updateVPCOffering.updateVPCOfferingCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpcoffering = apiclient.updateVPCOffering(cmd)
+        return vpcoffering
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteVPCOffering.deleteVPCOfferingCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpcoffering = apiclient.deleteVPCOffering(cmd)
+        return vpcoffering
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/VirtualMachine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VirtualMachine.py b/tools/marvin/marvin/integration/lib/base/VirtualMachine.py
index ba79d33..4a08454 100644
--- a/tools/marvin/marvin/integration/lib/base/VirtualMachine.py
+++ b/tools/marvin/marvin/integration/lib/base/VirtualMachine.py
@@ -16,6 +16,7 @@
 # under the License.
 from marvin.integration.lib.base import CloudStackEntity
 from marvin.cloudstackAPI import restoreVirtualMachine
+from marvin.cloudstackAPI import scaleVirtualMachine
 from marvin.cloudstackAPI import deployVirtualMachine
 from marvin.cloudstackAPI import migrateVirtualMachine
 from marvin.cloudstackAPI import listVirtualMachines
@@ -35,9 +36,21 @@ class VirtualMachine(CloudStackEntity.CloudStackEntity):
 
     def restore(self, apiclient, virtualmachineid, **kwargs):
         cmd = restoreVirtualMachine.restoreVirtualMachineCmd()
+        cmd.id = self.id
         cmd.virtualmachineid = virtualmachineid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         virtualmachine = apiclient.restoreVirtualMachine(cmd)
+        return virtualmachine
+
+
+    def scale(self, apiclient, id, serviceofferingid, **kwargs):
+        cmd = scaleVirtualMachine.scaleVirtualMachineCmd()
+        cmd.id = self.id
+        cmd.id = id
+        cmd.serviceofferingid = serviceofferingid
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
+        virtualmachine = apiclient.scaleVirtualMachine(cmd)
+        return virtualmachine
 
 
     @classmethod
@@ -51,59 +64,73 @@ class VirtualMachine(CloudStackEntity.CloudStackEntity):
 
     def migrate(self, apiclient, virtualmachineid, **kwargs):
         cmd = migrateVirtualMachine.migrateVirtualMachineCmd()
+        cmd.id = self.id
         cmd.virtualmachineid = virtualmachineid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         virtualmachine = apiclient.migrateVirtualMachine(cmd)
+        return virtualmachine
 
 
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listVirtualMachines.listVirtualMachinesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         virtualmachine = apiclient.listVirtualMachines(cmd)
         return map(lambda e: VirtualMachine(e.__dict__), virtualmachine)
 
 
     def stop(self, apiclient, id, **kwargs):
         cmd = stopVirtualMachine.stopVirtualMachineCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         virtualmachine = apiclient.stopVirtualMachine(cmd)
+        return virtualmachine
 
 
     def reboot(self, apiclient, id, **kwargs):
         cmd = rebootVirtualMachine.rebootVirtualMachineCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         virtualmachine = apiclient.rebootVirtualMachine(cmd)
+        return virtualmachine
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateVirtualMachine.updateVirtualMachineCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         virtualmachine = apiclient.updateVirtualMachine(cmd)
+        return virtualmachine
 
 
     def start(self, apiclient, id, **kwargs):
         cmd = startVirtualMachine.startVirtualMachineCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         virtualmachine = apiclient.startVirtualMachine(cmd)
+        return virtualmachine
 
 
     def destroy(self, apiclient, id, **kwargs):
         cmd = destroyVirtualMachine.destroyVirtualMachineCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         virtualmachine = apiclient.destroyVirtualMachine(cmd)
+        return virtualmachine
 
 
     def assign(self, apiclient, account, domainid, virtualmachineid, **kwargs):
         cmd = assignVirtualMachine.assignVirtualMachineCmd()
+        cmd.id = self.id
         cmd.account = account
         cmd.domainid = domainid
         cmd.virtualmachineid = virtualmachineid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         virtualmachine = apiclient.assignVirtualMachine(cmd)
+        return virtualmachine
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/VirtualRouterElement.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VirtualRouterElement.py b/tools/marvin/marvin/integration/lib/base/VirtualRouterElement.py
index 325d669..9faf355 100644
--- a/tools/marvin/marvin/integration/lib/base/VirtualRouterElement.py
+++ b/tools/marvin/marvin/integration/lib/base/VirtualRouterElement.py
@@ -38,15 +38,17 @@ class VirtualRouterElement(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listVirtualRouterElements.listVirtualRouterElementsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         virtualrouterelement = apiclient.listVirtualRouterElements(cmd)
         return map(lambda e: VirtualRouterElement(e.__dict__), virtualrouterelement)
 
 
     def configure(self, apiclient, enabled, id, **kwargs):
         cmd = configureVirtualRouterElement.configureVirtualRouterElementCmd()
+        cmd.id = self.id
         cmd.id = id
         cmd.enabled = enabled
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         virtualrouterelement = apiclient.configureVirtualRouterElement(cmd)
+        return virtualrouterelement
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/VlanIpRange.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VlanIpRange.py b/tools/marvin/marvin/integration/lib/base/VlanIpRange.py
index 8e134f3..f38e71b 100644
--- a/tools/marvin/marvin/integration/lib/base/VlanIpRange.py
+++ b/tools/marvin/marvin/integration/lib/base/VlanIpRange.py
@@ -38,14 +38,16 @@ class VlanIpRange(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listVlanIpRanges.listVlanIpRangesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vlaniprange = apiclient.listVlanIpRanges(cmd)
         return map(lambda e: VlanIpRange(e.__dict__), vlaniprange)
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteVlanIpRange.deleteVlanIpRangeCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vlaniprange = apiclient.deleteVlanIpRange(cmd)
+        return vlaniprange
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Volume.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Volume.py b/tools/marvin/marvin/integration/lib/base/Volume.py
index be9731a..d28e0a5 100644
--- a/tools/marvin/marvin/integration/lib/base/Volume.py
+++ b/tools/marvin/marvin/integration/lib/base/Volume.py
@@ -33,10 +33,12 @@ class Volume(CloudStackEntity.CloudStackEntity):
 
     def migrate(self, apiclient, storageid, volumeid, **kwargs):
         cmd = migrateVolume.migrateVolumeCmd()
+        cmd.id = self.id
         cmd.storageid = storageid
         cmd.volumeid = volumeid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         volume = apiclient.migrateVolume(cmd)
+        return volume
 
 
     @classmethod
@@ -51,47 +53,57 @@ class Volume(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listVolumes.listVolumesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         volume = apiclient.listVolumes(cmd)
         return map(lambda e: Volume(e.__dict__), volume)
 
 
     def upload(self, apiclient, url, zoneid, name, format, **kwargs):
         cmd = uploadVolume.uploadVolumeCmd()
+        cmd.id = self.id
         cmd.format = format
         cmd.name = name
         cmd.url = url
         cmd.zoneid = zoneid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         volume = apiclient.uploadVolume(cmd)
+        return volume
 
 
     def attach(self, apiclient, id, virtualmachineid, **kwargs):
         cmd = attachVolume.attachVolumeCmd()
+        cmd.id = self.id
         cmd.id = id
         cmd.virtualmachineid = virtualmachineid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         volume = apiclient.attachVolume(cmd)
+        return volume
 
 
     def detach(self, apiclient, **kwargs):
         cmd = detachVolume.detachVolumeCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        cmd.id = self.id
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         volume = apiclient.detachVolume(cmd)
+        return volume
 
 
     def extract(self, apiclient, zoneid, id, mode, **kwargs):
         cmd = extractVolume.extractVolumeCmd()
+        cmd.id = self.id
         cmd.id = id
         cmd.mode = mode
         cmd.zoneid = zoneid
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         volume = apiclient.extractVolume(cmd)
+        return volume
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteVolume.deleteVolumeCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         volume = apiclient.deleteVolume(cmd)
+        return volume
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/VpnConnection.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VpnConnection.py b/tools/marvin/marvin/integration/lib/base/VpnConnection.py
index d43c27b..33d6571 100644
--- a/tools/marvin/marvin/integration/lib/base/VpnConnection.py
+++ b/tools/marvin/marvin/integration/lib/base/VpnConnection.py
@@ -29,9 +29,11 @@ class VpnConnection(CloudStackEntity.CloudStackEntity):
 
     def reset(self, apiclient, id, **kwargs):
         cmd = resetVpnConnection.resetVpnConnectionCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpnconnection = apiclient.resetVpnConnection(cmd)
+        return vpnconnection
 
 
     @classmethod
@@ -46,14 +48,16 @@ class VpnConnection(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listVpnConnections.listVpnConnectionsCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpnconnection = apiclient.listVpnConnections(cmd)
         return map(lambda e: VpnConnection(e.__dict__), vpnconnection)
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteVpnConnection.deleteVpnConnectionCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpnconnection = apiclient.deleteVpnConnection(cmd)
+        return vpnconnection
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/VpnCustomerGateway.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VpnCustomerGateway.py b/tools/marvin/marvin/integration/lib/base/VpnCustomerGateway.py
index 49d746c..24324fc 100644
--- a/tools/marvin/marvin/integration/lib/base/VpnCustomerGateway.py
+++ b/tools/marvin/marvin/integration/lib/base/VpnCustomerGateway.py
@@ -39,26 +39,30 @@ class VpnCustomerGateway(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listVpnCustomerGateways.listVpnCustomerGatewaysCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpncustomergateway = apiclient.listVpnCustomerGateways(cmd)
         return map(lambda e: VpnCustomerGateway(e.__dict__), vpncustomergateway)
 
 
     def update(self, apiclient, ikepolicy, cidrlist, gateway, ipsecpsk, esppolicy, id, **kwargs):
         cmd = updateVpnCustomerGateway.updateVpnCustomerGatewayCmd()
+        cmd.id = self.id
         cmd.id = id
         cmd.cidrlist = cidrlist
         cmd.esppolicy = esppolicy
         cmd.gateway = gateway
         cmd.ikepolicy = ikepolicy
         cmd.ipsecpsk = ipsecpsk
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpncustomergateway = apiclient.updateVpnCustomerGateway(cmd)
+        return vpncustomergateway
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteVpnCustomerGateway.deleteVpnCustomerGatewayCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpncustomergateway = apiclient.deleteVpnCustomerGateway(cmd)
+        return vpncustomergateway
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/VpnGateway.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VpnGateway.py b/tools/marvin/marvin/integration/lib/base/VpnGateway.py
index e929937..0cbc68f 100644
--- a/tools/marvin/marvin/integration/lib/base/VpnGateway.py
+++ b/tools/marvin/marvin/integration/lib/base/VpnGateway.py
@@ -38,14 +38,16 @@ class VpnGateway(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listVpnGateways.listVpnGatewaysCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpngateway = apiclient.listVpnGateways(cmd)
         return map(lambda e: VpnGateway(e.__dict__), vpngateway)
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteVpnGateway.deleteVpnGatewayCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpngateway = apiclient.deleteVpnGateway(cmd)
+        return vpngateway
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/VpnUser.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/VpnUser.py b/tools/marvin/marvin/integration/lib/base/VpnUser.py
index d060a9d..b6b62b2 100644
--- a/tools/marvin/marvin/integration/lib/base/VpnUser.py
+++ b/tools/marvin/marvin/integration/lib/base/VpnUser.py
@@ -28,23 +28,27 @@ class VpnUser(CloudStackEntity.CloudStackEntity):
 
     def add(self, apiclient, username, password, **kwargs):
         cmd = addVpnUser.addVpnUserCmd()
+        cmd.id = self.id
         cmd.password = password
         cmd.username = username
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpnuser = apiclient.addVpnUser(cmd)
+        return vpnuser
 
 
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listVpnUsers.listVpnUsersCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpnuser = apiclient.listVpnUsers(cmd)
         return map(lambda e: VpnUser(e.__dict__), vpnuser)
 
 
     def remove(self, apiclient, username, **kwargs):
         cmd = removeVpnUser.removeVpnUserCmd()
+        cmd.id = self.id
         cmd.username = username
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         vpnuser = apiclient.removeVpnUser(cmd)
+        return vpnuser
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/base/Zone.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Zone.py b/tools/marvin/marvin/integration/lib/base/Zone.py
index 42a632c..77c314e 100644
--- a/tools/marvin/marvin/integration/lib/base/Zone.py
+++ b/tools/marvin/marvin/integration/lib/base/Zone.py
@@ -39,21 +39,25 @@ class Zone(CloudStackEntity.CloudStackEntity):
     @classmethod
     def list(self, apiclient, **kwargs):
         cmd = listZones.listZonesCmd()
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         zone = apiclient.listZones(cmd)
         return map(lambda e: Zone(e.__dict__), zone)
 
 
     def update(self, apiclient, id, **kwargs):
         cmd = updateZone.updateZoneCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         zone = apiclient.updateZone(cmd)
+        return zone
 
 
     def delete(self, apiclient, id, **kwargs):
         cmd = deleteZone.deleteZoneCmd()
+        cmd.id = self.id
         cmd.id = id
-        [setattr(cmd, key, value) for key,value in kwargs.items]
+        [setattr(cmd, key, value) for key,value in kwargs.iteritems()]
         zone = apiclient.deleteZone(cmd)
+        return zone
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/factory/DiskOfferingFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/DiskOfferingFactory.py b/tools/marvin/marvin/integration/lib/factory/DiskOfferingFactory.py
index 11c4df8..0ca22df 100644
--- a/tools/marvin/marvin/integration/lib/factory/DiskOfferingFactory.py
+++ b/tools/marvin/marvin/integration/lib/factory/DiskOfferingFactory.py
@@ -15,12 +15,13 @@
 # specific language governing permissions and limitations
 # under the License.
 import factory
+from marvin.integration.lib.factory.CloudStackBaseFactory import *
 from marvin.integration.lib.base import DiskOffering
 from marvin.integration.lib.utils import random_gen
 
-class DiskOfferingFactory(factory.Factory):
+class DiskOfferingFactory(CloudStackBaseFactory):
 
-    FACTORY_FOR = DiskOffering
+    FACTORY_FOR = DiskOffering.DiskOffering
 
     displaytext = factory.Sequence(lambda n : "DiskOffering" + random_gen())
     name = factory.Sequence(lambda n : "DiskOffering" + random_gen())

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/factory/NetworkOfferingFactory.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/NetworkOfferingFactory.py b/tools/marvin/marvin/integration/lib/factory/NetworkOfferingFactory.py
index 5f876c8..3673828 100644
--- a/tools/marvin/marvin/integration/lib/factory/NetworkOfferingFactory.py
+++ b/tools/marvin/marvin/integration/lib/factory/NetworkOfferingFactory.py
@@ -15,16 +15,71 @@
 # specific language governing permissions and limitations
 # under the License.
 import factory
+from marvin.integration.lib.factory.CloudStackBaseFactory import *
 from marvin.integration.lib.base import NetworkOffering
-class NetworkOfferingFactory(factory.Factory):
+from marvin.integration.lib.utils import random_gen
 
-    FACTORY_FOR = NetworkOffering
+class NetworkOfferingFactory(CloudStackBaseFactory):
+
+    FACTORY_FOR = NetworkOffering.NetworkOffering
 
     displaytext = "Network Offering"
     guestiptype = "Isolated"
     name = "Network Offering"
     supportedservices = "Dhcp,Dns,SourceNat,PortForwarding"
-    traffictype = "Guest"
+    traffictype = "GUEST"
+
+
+class DefaultIsolatedNetworkOfferingWithSourceNatServiceFactory(NetworkOfferingFactory):
+    #FIXME: Service Capability Lists with CapabilityTypes (ElasticIP, RvR etc) needs handling
+
+    displaytext = factory.Sequence(lambda n : "DefaultIsolatedNetworkOfferingWithSourceNatService" + random_gen())
+    name = factory.Sequence(lambda n : "DefaultIsolatedNetworkOfferingWithSourceNatService" + random_gen())
+    supportedservices = "Lb,Dns,PortForwarding,StaticNat,Dhcp,Firewall,Vpn,UserData,SourceNat"
+    traffictype = "GUEST"
+    availability = "Optional"
+    guestiptype = "Isolated"
+
+    specifyVlan = False
+    specifyIpRanges = False
+    isPersistent = False
+    conserveMode = True
+
+    serviceProviderList = []
+    for service in map(lambda l: l.strip(' '), supportedservices.split(',')):
+        serviceProviderList.append(
+            {
+                'service': service,
+                'provider': 'VirtualRouter'
+            }
+        )
+
+
+class DefaultSharedNetworkOfferingWithSGServiceFactory(NetworkOfferingFactory):
+
+    displaytext = factory.Sequence(lambda n : "DefaultSharedNetworkOfferingWithSGService" + random_gen())
+    name = factory.Sequence(lambda n : "DefaultSharedNetworkOfferingWithSGService" + random_gen())
+    availability = "Optional"
+    supportedservices = "SecurityGroup, Dns, Dhcp, UserData"
+    guestiptype = "Shared"
+    traffictype = "GUEST"
+
+    specifyVlan = True
+    specifyIpRanges = True
+    isPersistent = False
+    conserveMode = True
+
+    serviceProviderList = []
+    for service in map(lambda l: l.strip(' '), supportedservices.split(',')):
+        if service == 'SecurityGroup':
+            provider = 'SecurityGroupProvider'
+        else:
+            provider = 'VirtualRouter'
+        serviceProviderList.append(
+            {
+                'service': service,
+                'provider': provider
+            }
+        )
 
 
-class DefaultIsolatedNetworkOffering

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/factory/test/testFactories.py b/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
index d8afb03..1d18305 100644
--- a/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
+++ b/tools/marvin/marvin/integration/lib/factory/test/testFactories.py
@@ -16,12 +16,16 @@
 # under the License.
 
 import unittest
+from marvin.cloudstackTestClient import cloudstackTestClient
+
 from marvin.integration.lib.factory.AccountFactory import *
 from marvin.integration.lib.base.Account import *
 
 from marvin.integration.lib.factory.ServiceOfferingFactory import *
 from marvin.integration.lib.base.ServiceOffering import *
-from marvin.cloudstackTestClient import cloudstackTestClient
+
+from marvin.integration.lib.factory.NetworkOfferingFactory import *
+from marvin.integration.lib.base.NetworkOffering import *
 
 class AccountFactoryTest(unittest.TestCase):
     def setUp(self):
@@ -45,6 +49,14 @@ class AccountFactoryTest(unittest.TestCase):
         self.assertTrue(accnt is not None, msg="no account created by factory")
         self.assertEqual(accnt.name, af.username, msg="account names are not same")
 
+    @unittest.skip("Job Queue gets stuck on this")
+    def test_disableAccountPostFactoryGeneration(self):
+        af = DomainAdminFactory()
+        domadmin = Account.create(apiclient=self.apiClient, AccountFactory=af)
+        self.assertTrue(domadmin is not None, msg="no account was created")
+        self.assertEqual(domadmin.name, af.username, msg = "account names don't match")
+        domadmin.disable(self.apiClient, lock=True)
+
     def tearDown(self):
         pass
 
@@ -61,4 +73,17 @@ class ServiceOfferingFactoryTest(unittest.TestCase):
 
 
     def tearDown(self):
-        pass
\ No newline at end of file
+        pass
+
+
+class NetworkOfferingFactoryTest(unittest.TestCase):
+    def setUp(self):
+        self.apiClient = cloudstackTestClient(mgtSvr='localhost').getApiClient()
+
+    def test_defaultSourceNatOfferingFactory(self):
+        snatOfferingFactory = DefaultIsolatedNetworkOfferingWithSourceNatServiceFactory()
+        snatOffering = NetworkOffering.create(apiclient=self.apiClient, NetworkOfferingFactory=snatOfferingFactory)
+        self.assertTrue(snatOffering is not None, msg = "no network offering was created")
+        self.assertEqual(snatOffering.name, snatOfferingFactory.name, msg="error in network offering factory creation")
+
+        snatOffering.update(self.apiClient, state='Enabled')

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cef66347/tools/marvin/marvin/integration/lib/generateBase.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/generateBase.py b/tools/marvin/marvin/integration/lib/generateBase.py
index c2955d9..2b213ff 100644
--- a/tools/marvin/marvin/integration/lib/generateBase.py
+++ b/tools/marvin/marvin/integration/lib/generateBase.py
@@ -27,7 +27,8 @@ grammar = ['create', 'list', 'delete', 'update',
            'start', 'restart', 'reboot', 'stop', 'reconnect',
            'cancel', 'destroy', 'revoke', 'mark', 'reset',
            'copy', 'extract', 'migrate', 'restore', 'suspend',
-           'get', 'query', 'prepare', 'deploy', 'upload', 'lock', 'disassociate']
+           'get', 'query', 'prepare', 'deploy', 'upload', 'lock',
+           'disassociate', 'scale']
 
 LICENSE = """# Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -136,12 +137,15 @@ def write_entity_classes(entities):
                 else:
                     body.append(tabspace + 'def %s(self, apiclient, **kwargs):'%(action))
                 body.append(tabspace*2 + 'cmd = %(module)s.%(command)s()'%{"module": details["apimodule"], "command": details["apicmd"]})
+                body.append(tabspace*2 + 'cmd.id = self.id')
                 for arg in details['args']:
                     body.append(tabspace*2 + 'cmd.%s = %s'%(arg, arg))
-                body.append(tabspace*2 + '[setattr(cmd, key, value) for key,value in kwargs.items]')
+                body.append(tabspace*2 + '[setattr(cmd, key, value) for key,value in kwargs.iteritems()]')
                 body.append(tabspace*2 + '%s = apiclient.%s(cmd)'%(entity.lower(), details['apimodule']))
                 if action in ['list']:
                     body.append(tabspace*2 + 'return map(lambda e: %s(e.__dict__), %s)'%(entity, entity.lower()))
+                else:
+                    body.append(tabspace*2 + 'return %s'%(entity.lower()))
             body.append('\n')
 
         imports = '\n'.join(imports)
@@ -149,7 +153,7 @@ def write_entity_classes(entities):
         code = imports + '\n\n' + body
 
         entitydict[entity] = code
-        write_entity_factory(entity, actions)
+        #write_entity_factory(entity, actions)
         with open("./base/%s.py"%entity, "w") as writer:
             writer.write(LICENSE)
             writer.write(code)


[16/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
CLOUDSTACK-1065: cloudstack UI - AWS Style Regions - allow user to delete region whose end point matches the current URL, but set region button on top menu to blank after the region is deleted.


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

Branch: refs/heads/marvin_refactor
Commit: fc946ae542a9e3d48cfde42ae4cd8a1f81d7dfb3
Parents: b9dc546
Author: Jessica Wang <je...@citrix.com>
Authored: Fri Mar 22 12:02:27 2013 -0700
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:02:55 2013 +0530

----------------------------------------------------------------------
 ui/scripts/regions.js           |    2 ++
 ui/scripts/ui-custom/regions.js |    3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fc946ae5/ui/scripts/regions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/regions.js b/ui/scripts/regions.js
index a271a1a..70d18ef 100644
--- a/ui/scripts/regions.js
+++ b/ui/scripts/regions.js
@@ -130,10 +130,12 @@
 							region.endpoint	== "http://localhost:8080/client/"
 							document.location.href == "http://localhost:8080/client/#"
 							*/
+							/*
 							if(document.location.href.indexOf(region.endpoint) != -1) {
 							  cloudStack.dialog.notice({ message: _l('You can not remove the region that you are currently in.') });
                 return false;
 							}
+              */
               return true;
             },
             action: function(args) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fc946ae5/ui/scripts/ui-custom/regions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/regions.js b/ui/scripts/ui-custom/regions.js
index 9c139e5..8210898 100644
--- a/ui/scripts/ui-custom/regions.js
+++ b/ui/scripts/ui-custom/regions.js
@@ -51,6 +51,9 @@
             if(currentRegion != null)	{
 						  $regionSwitcherButton.find('.title').html(_s(currentRegion.name)).attr('title', _s(currentRegion.name));
             }
+            else {
+              $regionSwitcherButton.find('.title').html('').attr('title', '');
+            }
           }
         }
       });


[50/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
Merge branch 'marvin-refactor' into marvin_refactor

rebase hell.

Conflicts:
	client/pom.xml
	client/tomcatconf/applicationContext.xml.in
	client/tomcatconf/componentContext.xml.in
	client/tomcatconf/nonossComponentContext.xml.in
	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/network/NetworkModelImpl.java
	server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
	server/src/com/cloud/user/AccountManagerImpl.java
	server/src/com/cloud/vm/dao/NicDao.java
	setup/db/db/schema-410to420-cleanup.sql
	tools/cli/cloudmonkey/cloudmonkey.py
	tools/marvin/marvin/TestCaseExecuteEngine.py
	tools/marvin/pom.xml
	tools/marvin/setup.py
	ui/scripts/cloud.core.callbacks.js
	ui/scripts/cloudStack.js
	ui/scripts/regions.js
	ui/scripts/system.js
	ui/scripts/ui-custom/regions.js


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

Branch: refs/heads/marvin_refactor
Commit: 2a9906424d8d6df316c0f197f20c36e5cc476b7f
Parents: 9180bd5 cbc5ffa
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Tue Apr 9 18:49:18 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Tue Apr 9 18:49:27 2013 +0530

----------------------------------------------------------------------
 api/src/com/cloud/network/vpc/Vpc.java             |   26 +-
 api/src/com/cloud/network/vpc/VpcOffering.java     |   10 +-
 .../cloud/network/vpc/VpcProvisioningService.java  |   10 +-
 api/src/com/cloud/network/vpc/VpcService.java      |   74 +-
 .../api/command/user/network/UpdateNetworkCmd.java |    2 +-
 .../command/user/template/DeleteTemplateCmd.java   |    4 +-
 .../command/user/template/ExtractTemplateCmd.java  |    4 +-
 .../api/response/RemoteAccessVpnResponse.java      |    7 +
 awsapi/conf/applicationContext.xml.in              |    4 +-
 .../vmware/manager/VmwareStorageManagerImpl.java   |    2 +-
 pom.xml                                            |    8 +-
 .../xenserver/Add-To-VCPUs-Params-Live.sh          |    1 -
 server/pom.xml                                     |    2 +-
 .../network/ExternalFirewallDeviceManagerImpl.java |    2 +-
 .../src/com/cloud/network/NetworkServiceImpl.java  |    6 +
 .../com/cloud/network/dao/RemoteAccessVpnVO.java   |    6 +-
 .../com/cloud/network/guru/DirectNetworkGuru.java  |   10 +-
 .../network/guru/DirectPodBasedNetworkGuru.java    |    8 +-
 .../router/VpcVirtualNetworkApplianceManager.java  |    2 +-
 server/src/com/cloud/network/vpc/VpcManager.java   |   26 +-
 .../src/com/cloud/network/vpc/VpcManagerImpl.java  |   10 +-
 .../network/vpn/RemoteAccessVpnManagerImpl.java    |    6 +-
 .../src/com/cloud/server/ManagementServerImpl.java |   16 +
 .../src/com/cloud/storage/VolumeManagerImpl.java   |  107 +-
 server/src/com/cloud/upgrade/DatabaseCreator.java  |   10 +-
 .../src/com/cloud/upgrade/dao/Upgrade410to420.java |    8 +-
 server/test/com/cloud/vpc/MockVpcManagerImpl.java  |    2 +-
 .../networkoffering/CreateNetworkOfferingTest.java |   40 +-
 .../resources/SecurityGroupManagerTestContext.xml  |   18 +-
 server/test/resources/SnapshotDaoTestContext.xml   |   22 +-
 .../test/resources/StoragePoolDaoTestContext.xml   |   22 +-
 server/test/resources/VpcApiUnitTestContext.xml    |   22 +-
 server/test/resources/VpcTestContext.xml           |   24 +-
 server/test/resources/createNetworkOffering.xml    |   92 +-
 server/test/resources/testContext.xml              |   20 +-
 test/integration/smoke/test_ScaleVm.py             |   26 +-
 tools/apidoc/gen_toc.py                            |    1 +
 tools/appliance/definitions/devcloud/cleanup.sh    |    1 -
 tools/marvin/marvin/integration/lib/base.py        | 2426 -
 .../marvin/marvin/integration/lib/base/Account.py  |  103 +
 tools/marvin/marvin/integration/lib/base/Alerts.py |   42 +
 .../marvin/marvin/integration/lib/base/ApiLimit.py |   42 +
 tools/marvin/marvin/integration/lib/base/Apis.py   |   33 +
 .../marvin/integration/lib/base/AsyncJobResult.py  |   34 +
 .../marvin/integration/lib/base/AsyncJobs.py       |   33 +
 .../marvin/integration/lib/base/AutoScalePolicy.py |   62 +
 .../integration/lib/base/AutoScaleVmGroup.py       |   83 +
 .../integration/lib/base/AutoScaleVmProfile.py     |   63 +
 .../integration/lib/base/BigSwitchVnsDevice.py     |   54 +
 .../marvin/integration/lib/base/Capabilities.py    |   33 +
 .../marvin/marvin/integration/lib/base/Capacity.py |   33 +
 .../marvin/integration/lib/base/CloudIdentifier.py |   34 +
 .../integration/lib/base/CloudStackEntity.py       |   25 +
 .../marvin/marvin/integration/lib/base/Cluster.py  |   67 +
 .../marvin/integration/lib/base/Condition.py       |   53 +
 .../marvin/integration/lib/base/Configuration.py   |   43 +
 .../marvin/marvin/integration/lib/base/Counter.py  |   53 +
 .../integration/lib/base/CustomCertificate.py      |   35 +
 .../marvin/integration/lib/base/DiskOffering.py    |   63 +
 tools/marvin/marvin/integration/lib/base/Domain.py |   63 +
 .../marvin/integration/lib/base/DomainChildren.py  |   33 +
 .../integration/lib/base/EgressFirewallRule.py     |   53 +
 .../marvin/integration/lib/base/EventTypes.py      |   33 +
 tools/marvin/marvin/integration/lib/base/Events.py |   42 +
 .../marvin/integration/lib/base/FirewallRule.py    |   53 +
 .../integration/lib/base/GlobalLoadBalancerRule.py |   80 +
 tools/marvin/marvin/integration/lib/base/Host.py   |  107 +
 .../integration/lib/base/HypervisorCapabilities.py |   42 +
 .../marvin/integration/lib/base/Hypervisors.py     |   33 +
 .../marvin/integration/lib/base/InstanceGroup.py   |   63 +
 .../marvin/integration/lib/base/IpAddress.py       |   43 +
 .../integration/lib/base/IpForwardingRule.py       |   53 +
 tools/marvin/marvin/integration/lib/base/Iso.py    |  110 +
 .../marvin/integration/lib/base/IsoPermissions.py  |   44 +
 .../integration/lib/base/LBHealthCheckPolicy.py    |   53 +
 .../integration/lib/base/LBStickinessPolicy.py     |   55 +
 tools/marvin/marvin/integration/lib/base/Ldap.py   |   42 +
 .../integration/lib/base/LoadBalancerRule.py       |   93 +
 .../marvin/marvin/integration/lib/base/Network.py  |   73 +
 .../marvin/integration/lib/base/NetworkACL.py      |   53 +
 .../marvin/integration/lib/base/NetworkDevice.py   |   52 +
 .../marvin/integration/lib/base/NetworkOffering.py |   62 +
 .../integration/lib/base/NetworkServiceProvider.py |   64 +
 tools/marvin/marvin/integration/lib/base/Nic.py    |   56 +
 .../marvin/integration/lib/base/NiciraNvpDevice.py |   66 +
 .../marvin/integration/lib/base/OsCategories.py    |   33 +
 .../marvin/marvin/integration/lib/base/OsTypes.py  |   33 +
 .../marvin/integration/lib/base/PhysicalNetwork.py |   61 +
 tools/marvin/marvin/integration/lib/base/Pod.py    |   61 +
 .../integration/lib/base/PortForwardingRule.py     |   65 +
 .../marvin/integration/lib/base/PrivateGateway.py  |   52 +
 .../marvin/marvin/integration/lib/base/Project.py  |  107 +
 .../integration/lib/base/ProjectInvitation.py      |   53 +
 .../integration/lib/base/PublicIpAddresses.py      |   33 +
 tools/marvin/marvin/integration/lib/base/Region.py |   65 +
 .../marvin/integration/lib/base/RemoteAccessVpn.py |   54 +
 .../marvin/integration/lib/base/ResourceCount.py   |   34 +
 .../marvin/integration/lib/base/ResourceLimit.py   |   43 +
 tools/marvin/marvin/integration/lib/base/Router.py |   73 +
 tools/marvin/marvin/integration/lib/base/S3.py     |   45 +
 .../marvin/integration/lib/base/SSHKeyPair.py      |   64 +
 .../integration/lib/base/SecondaryStorage.py       |   34 +
 .../marvin/integration/lib/base/SecurityGroup.py   |   82 +
 .../integration/lib/base/ServiceForRouter.py       |   35 +
 .../integration/lib/base/ServiceForSystemVm.py     |   35 +
 .../lib/base/ServiceForVirtualMachine.py           |   35 +
 .../marvin/integration/lib/base/ServiceOffering.py |   63 +
 .../marvin/integration/lib/base/Simulator.py       |   35 +
 .../marvin/marvin/integration/lib/base/Snapshot.py |   52 +
 .../marvin/integration/lib/base/SnapshotPolicy.py  |   52 +
 .../marvin/integration/lib/base/StaticNat.py       |   45 +
 .../marvin/integration/lib/base/StaticRoute.py     |   53 +
 .../integration/lib/base/StorageNetworkIpRange.py  |   63 +
 .../marvin/integration/lib/base/StoragePool.py     |   81 +
 .../integration/lib/base/StorageProviders.py       |   33 +
 .../lib/base/SupportedNetworkServices.py           |   33 +
 tools/marvin/marvin/integration/lib/base/Swift.py  |   43 +
 .../marvin/marvin/integration/lib/base/SystemVm.py |   84 +
 tools/marvin/marvin/integration/lib/base/Tags.py   |   54 +
 .../marvin/marvin/integration/lib/base/Template.py |  114 +
 .../integration/lib/base/TemplatePermissions.py    |   44 +
 .../marvin/integration/lib/base/TrafficMonitor.py  |   55 +
 .../marvin/integration/lib/base/TrafficType.py     |   65 +
 .../lib/base/TrafficTypeImplementors.py            |   33 +
 .../marvin/integration/lib/base/UsageRecords.py    |   46 +
 .../marvin/integration/lib/base/UsageTypes.py      |   33 +
 tools/marvin/marvin/integration/lib/base/User.py   |  112 +
 .../marvin/integration/lib/base/VMPassword.py      |   34 +
 .../marvin/integration/lib/base/VMSnapshot.py      |   53 +
 tools/marvin/marvin/integration/lib/base/VPC.py    |   71 +
 .../marvin/integration/lib/base/VPCOffering.py     |   62 +
 .../marvin/integration/lib/base/VirtualMachine.py  |  178 +
 .../integration/lib/base/VirtualRouterElement.py   |   54 +
 .../marvin/integration/lib/base/VlanIpRange.py     |   53 +
 tools/marvin/marvin/integration/lib/base/Volume.py |  109 +
 .../marvin/integration/lib/base/VpnConnection.py   |   63 +
 .../integration/lib/base/VpnCustomerGateway.py     |   68 +
 .../marvin/integration/lib/base/VpnGateway.py      |   53 +
 .../marvin/marvin/integration/lib/base/VpnUser.py  |   54 +
 tools/marvin/marvin/integration/lib/base/Zone.py   |   63 +
 .../marvin/marvin/integration/lib/base/__init__.py |   16 +
 .../integration/lib/factory/AccountFactory.py      |   45 +
 .../lib/factory/AccountFromProjectFactory.py       |    8 +
 .../lib/factory/AccountToProjectFactory.py         |    7 +
 .../integration/lib/factory/AlertsFactory.py       |    5 +
 .../marvin/integration/lib/factory/ApisFactory.py  |    5 +
 .../lib/factory/AsyncJobResultFactory.py           |    7 +
 .../integration/lib/factory/AsyncJobsFactory.py    |    5 +
 .../lib/factory/AutoScalePoliciesFactory.py        |    5 +
 .../lib/factory/AutoScalePolicyFactory.py          |   25 +
 .../lib/factory/AutoScaleVmGroupFactory.py         |   28 +
 .../lib/factory/AutoScaleVmProfileFactory.py       |   25 +
 .../integration/lib/factory/CapabilitiesFactory.py |    5 +
 .../integration/lib/factory/CapacityFactory.py     |    5 +
 .../lib/factory/CloudIdentifierFactory.py          |    7 +
 .../lib/factory/CloudStackBaseFactory.py           |   27 +
 .../integration/lib/factory/ClusterFactory.py      |   25 +
 .../integration/lib/factory/ConditionFactory.py    |   25 +
 .../integration/lib/factory/ConfigFactory.py       |    9 +
 .../lib/factory/ConfigurationFactory.py            |   11 +
 .../integration/lib/factory/CounterFactory.py      |   25 +
 .../lib/factory/CustomCertificateFactory.py        |    8 +
 .../lib/factory/DefaultZoneForAccountFactory.py    |    9 +
 .../integration/lib/factory/DiskOfferingFactory.py |   42 +
 .../lib/factory/DomainChildrenFactory.py           |    5 +
 .../integration/lib/factory/DomainFactory.py       |   24 +
 .../lib/factory/EgressFirewallRuleFactory.py       |   24 +
 .../integration/lib/factory/EventTypesFactory.py   |    5 +
 .../integration/lib/factory/EventsFactory.py       |    5 +
 .../integration/lib/factory/FirewallRuleFactory.py |   24 +
 .../lib/factory/FromLoadBalancerRuleFactory.py     |    8 +
 .../marvin/integration/lib/factory/HostFactory.py  |   31 +
 .../lib/factory/HostForMaintenanceFactory.py       |    7 +
 .../lib/factory/HostMaintenanceFactory.py          |    7 +
 .../integration/lib/factory/HostPasswordFactory.py |    8 +
 .../lib/factory/HypervisorCapabilitiesFactory.py   |    9 +
 .../integration/lib/factory/HypervisorsFactory.py  |    5 +
 .../lib/factory/InstanceGroupFactory.py            |   23 +
 .../integration/lib/factory/IpAddressFactory.py    |   22 +
 .../lib/factory/IpForwardingRuleFactory.py         |   25 +
 .../marvin/integration/lib/factory/IsoFactory.py   |   26 +
 .../lib/factory/IsoPermissionsFactory.py           |   12 +
 .../lib/factory/LBStickinessPoliciesFactory.py     |    7 +
 .../lib/factory/LBStickinessPolicyFactory.py       |   25 +
 .../lib/factory/LoadBalancerRuleFactory.py         |   26 +
 .../factory/LoadBalancerRuleInstancesFactory.py    |    7 +
 .../integration/lib/factory/NetworkACLFactory.py   |   24 +
 .../lib/factory/NetworkDeviceFactory.py            |   15 +
 .../integration/lib/factory/NetworkFactory.py      |   26 +
 .../lib/factory/NetworkOfferingFactory.py          |   85 +
 .../lib/factory/NetworkServiceProviderFactory.py   |   22 +
 .../lib/factory/NiciraNvpDeviceFactory.py          |   20 +
 .../lib/factory/NiciraNvpDeviceNetworksFactory.py  |    7 +
 .../integration/lib/factory/OsCategoriesFactory.py |    5 +
 .../integration/lib/factory/OsTypesFactory.py      |    5 +
 .../factory/PasswordForVirtualMachineFactory.py    |    7 +
 .../lib/factory/PhysicalNetworkFactory.py          |   24 +
 .../marvin/integration/lib/factory/PodFactory.py   |   27 +
 .../lib/factory/PortForwardingRuleFactory.py       |   27 +
 .../lib/factory/PrivateGatewayFactory.py           |   27 +
 .../lib/factory/ProjectAccountsFactory.py          |    7 +
 .../integration/lib/factory/ProjectFactory.py      |   24 +
 .../lib/factory/ProjectInvitationFactory.py        |   16 +
 .../lib/factory/PublicIpAddressesFactory.py        |    5 +
 .../lib/factory/RemoteAccessVpnFactory.py          |   23 +
 .../integration/lib/factory/RemoveFactory.py       |    5 +
 .../lib/factory/ResourceCountFactory.py            |    7 +
 .../lib/factory/ResourceLimitFactory.py            |   11 +
 .../integration/lib/factory/RouterFactory.py       |   26 +
 .../marvin/integration/lib/factory/S3Factory.py    |   12 +
 .../integration/lib/factory/SSHKeyPairFactory.py   |   23 +
 .../lib/factory/SecondaryStorageFactory.py         |    7 +
 .../lib/factory/SecurityGroupEgressFactory.py      |   11 +
 .../lib/factory/SecurityGroupFactory.py            |   23 +
 .../lib/factory/SecurityGroupIngressFactory.py     |   11 +
 .../lib/factory/ServiceForRouterFactory.py         |    8 +
 .../lib/factory/ServiceForSystemVmFactory.py       |    8 +
 .../lib/factory/ServiceForVirtualMachineFactory.py |    8 +
 .../lib/factory/ServiceOfferingFactory.py          |   38 +
 .../integration/lib/factory/SnapshotFactory.py     |   23 +
 .../lib/factory/SnapshotPoliciesFactory.py         |   10 +
 .../lib/factory/SnapshotPolicyFactory.py           |   27 +
 .../integration/lib/factory/StaticNatFactory.py    |   13 +
 .../integration/lib/factory/StaticRouteFactory.py  |   24 +
 .../lib/factory/StorageMaintenanceFactory.py       |   12 +
 .../lib/factory/StorageNetworkIpRangeFactory.py    |   26 +
 .../integration/lib/factory/StoragePoolFactory.py  |   30 +
 .../lib/factory/SupportedNetworkServicesFactory.py |    5 +
 .../marvin/integration/lib/factory/SwiftFactory.py |   10 +
 .../integration/lib/factory/SystemVmFactory.py     |   32 +
 .../marvin/integration/lib/factory/TagsFactory.py  |   25 +
 .../integration/lib/factory/TemplateFactory.py     |   32 +
 .../lib/factory/TemplatePermissionsFactory.py      |   12 +
 .../lib/factory/ToLoadBalancerRuleFactory.py       |    8 +
 .../lib/factory/TrafficMonitorFactory.py           |   18 +
 .../integration/lib/factory/TrafficTypeFactory.py  |   23 +
 .../lib/factory/TrafficTypeImplementorsFactory.py  |    5 +
 .../integration/lib/factory/UsageRecordsFactory.py |   14 +
 .../integration/lib/factory/UsageTypesFactory.py   |    5 +
 .../marvin/integration/lib/factory/UserFactory.py  |   29 +
 .../integration/lib/factory/UserKeysFactory.py     |   23 +
 .../integration/lib/factory/VMPasswordFactory.py   |    7 +
 .../integration/lib/factory/VMSnapshotFactory.py   |   23 +
 .../marvin/integration/lib/factory/VPCFactory.py   |   27 +
 .../integration/lib/factory/VPCOfferingFactory.py  |   25 +
 .../lib/factory/VirtualMachineFactory.py           |   28 +
 .../lib/factory/VirtualRouterElementFactory.py     |   23 +
 .../integration/lib/factory/VlanIpRangeFactory.py  |   23 +
 .../integration/lib/factory/VolumeFactory.py       |   23 +
 .../lib/factory/VpnConnectionFactory.py            |   24 +
 .../lib/factory/VpnCustomerGatewayFactory.py       |   27 +
 .../integration/lib/factory/VpnGatewayFactory.py   |   23 +
 .../integration/lib/factory/VpnUserFactory.py      |   17 +
 .../marvin/integration/lib/factory/ZoneFactory.py  |   26 +
 .../marvin/integration/lib/factory/__init__.py     |   16 +
 .../integration/lib/factory/test/__init__.py       |   16 +
 .../integration/lib/factory/test/testFactories.py  |  119 +
 .../marvin/marvin/integration/lib/generateBase.py  |  202 +
 tools/marvin/marvin/integration/lib/newbase.py     |62907 +++++++++++++++
 tools/marvin/marvin/integration/lib/oldbase.py     | 2426 +
 tools/marvin/marvin/jsonHelper.py                  |   28 +-
 ui/scripts/accounts.js                             |  145 +-
 ui/scripts/zoneWizard.js                           |   12 +-
 .../src/com/cloud/utils/component/AdapterBase.java |    2 +-
 .../cloud/utils/component/ComponentContext.java    |   32 +-
 .../ComponentInstantiationPostProcessor.java       |   24 +-
 .../component/ComponentMethodInterceptor.java      |    2 +-
 .../utils/component/ComponentNamingPolicy.java     |    6 +-
 utils/src/com/cloud/utils/db/GenericDaoBase.java   |    2 +-
 .../cloud/utils/db/TransactionContextBuilder.java  |   24 +-
 utils/test/resources/testContext.xml               |   16 +-
 271 files changed, 73816 insertions(+), 2974 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2a990642/server/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2a990642/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2a990642/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2a990642/server/src/com/cloud/network/guru/DirectNetworkGuru.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/network/guru/DirectNetworkGuru.java
index 84008c0,c53bbb7..870ae80
--- a/server/src/com/cloud/network/guru/DirectNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/DirectNetworkGuru.java
@@@ -257,9 -257,9 +257,9 @@@ public class DirectNetworkGuru extends 
              if (ip != null) {
                  Transaction txn = Transaction.currentTxn();
                  txn.start();
-                 
+ 
                  // if the ip address a part of placeholder, don't release it
 -                Nic placeholderNic = _networkModel.getPlaceholderNic(network, null);
 +                Nic placeholderNic = _networkModel.getPlaceholderNicForRouter(network, null);
                  if (placeholderNic != null && placeholderNic.getIp4Address().equalsIgnoreCase(ip.getAddress().addr())) {
                      s_logger.debug("Not releasing direct ip " + ip.getId() +" yet as its ip is saved in the placeholder");
                  } else {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2a990642/server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java
index cf27986,8f15d5a..e2ab17d
--- a/server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java
@@@ -197,13 -196,13 +197,13 @@@ public class DirectPodBasedNetworkGuru 
              }
              nic.setReservationId(String.valueOf(ip.getVlanTag()));
              nic.setMacAddress(ip.getMacAddress());
-             
+ 
              //save the placeholder nic if the vm is the Virtual router
              if (vm.getType() == VirtualMachine.Type.DomainRouter) {
 -                Nic placeholderNic = _networkModel.getPlaceholderNic(network, null);
 +                Nic placeholderNic = _networkModel.getPlaceholderNicForRouter(network, pod.getId());
                  if (placeholderNic == null) {
 -                    s_logger.debug("Saving placeholder nic with ip4 address " + nic.getIp4Address() + " for the network " + network + " with the gateway " + podRangeGateway);
 -                    _networkMgr.savePlaceholderNic(network, nic.getIp4Address());
 +                    s_logger.debug("Saving placeholder nic with ip4 address " + nic.getIp4Address() + " for the network " + network);
 +                    _networkMgr.savePlaceholderNic(network, nic.getIp4Address(), VirtualMachine.Type.DomainRouter);
                  }
              }
              txn.commit();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2a990642/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2a990642/server/src/com/cloud/storage/VolumeManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2a990642/server/src/com/cloud/upgrade/dao/Upgrade410to420.java
----------------------------------------------------------------------


[40/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064

Posted by ts...@apache.org.
VNS device APIs, VMSnapshot APIs, changes to factory creation

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


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

Branch: refs/heads/marvin_refactor
Commit: dfc703fa235c39876fd4f264b7b2b62a50d35f14
Parents: 04bd6d1
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Mon Mar 18 17:56:09 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Mar 31 22:19:28 2013 +0530

----------------------------------------------------------------------
 .../marvin/marvin/integration/lib/base/Account.py  |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dfc703fa/tools/marvin/marvin/integration/lib/base/Account.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base/Account.py b/tools/marvin/marvin/integration/lib/base/Account.py
index c9698eb..b5ad12a 100644
--- a/tools/marvin/marvin/integration/lib/base/Account.py
+++ b/tools/marvin/marvin/integration/lib/base/Account.py
@@ -23,7 +23,7 @@ from marvin.cloudstackAPI import updateAccount
 from marvin.cloudstackAPI import disableAccount
 from marvin.cloudstackAPI import deleteAccount
 
-class Account(CloudStackEntity.CloudStackEntity):
+class Account(CloudStackEntity):
 
 
     def __init__(self, items):