CLOUDSTACK-3620: [Automation] API removevpnuser failed, in test case test_project_usage.TestVpnUsage.test_01_vpn_usage.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
(cherry picked from commit ecfeaa1037)
This commit is contained in:
Sanjay Tripathi 2013-07-19 20:39:02 +05:30 committed by Prasanna Santhanam
parent 182de56743
commit 5eaec0a5e0
2 changed files with 10 additions and 4 deletions

View File

@ -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)

View File

@ -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