From 5eaec0a5e0611f75a362e58cbb325eb2067ae94e Mon Sep 17 00:00:00 2001 From: Sanjay Tripathi Date: Fri, 19 Jul 2013 20:39:02 +0530 Subject: [PATCH] CLOUDSTACK-3620: [Automation] API removevpnuser failed, in test case test_project_usage.TestVpnUsage.test_01_vpn_usage. Signed-off-by: Prasanna Santhanam (cherry picked from commit ecfeaa1037b18920ce3c734fa67f0ab309d46956) --- test/integration/component/test_project_usage.py | 5 ++++- tools/marvin/marvin/integration/lib/base.py | 9 ++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/test/integration/component/test_project_usage.py b/test/integration/component/test_project_usage.py index bb253e1c04a..1422febf975 100644 --- a/test/integration/component/test_project_usage.py +++ b/test/integration/component/test_project_usage.py @@ -1659,7 +1659,10 @@ class TestVpnUsage(cloudstackTestCase): # Remove VPN user self.debug("Deleting VPN user: %s" % vpnuser.id) - vpnuser.delete(self.apiclient) + vpnuser.delete( + self.apiclient, + projectid=self.project.id + ) # Delete VPN access self.debug("Deleting VPN: %s" % vpn.publicipid) diff --git a/tools/marvin/marvin/integration/lib/base.py b/tools/marvin/marvin/integration/lib/base.py index 13507bc8ac4..03c0707d335 100755 --- a/tools/marvin/marvin/integration/lib/base.py +++ b/tools/marvin/marvin/integration/lib/base.py @@ -2100,13 +2100,16 @@ class VpnUser: cmd.projectid = projectid return VpnUser(apiclient.addVpnUser(cmd).__dict__) - def delete(self, apiclient): + def delete(self, apiclient, projectid=None): """Remove VPN user""" cmd = removeVpnUser.removeVpnUserCmd() cmd.username = self.username - cmd.account = self.account - cmd.domainid = self.domainid + if projectid: + cmd.projectid = projectid + else: + cmd.account = self.account + cmd.domainid = self.domainid apiclient.removeVpnUser(cmd) @classmethod