From 289c53535eebeb7fbdadaefbfedf0e813d8ef295 Mon Sep 17 00:00:00 2001 From: Prasanna Santhanam Date: Mon, 14 May 2012 19:35:24 +0530 Subject: [PATCH] MD5 Auth for accounts created on the API --- tools/marvin/marvin/cloudstackTestClient.py | 7 ++++++- tools/testClient/cloudstackTestClient.py | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/marvin/marvin/cloudstackTestClient.py b/tools/marvin/marvin/cloudstackTestClient.py index 29765fac2f9..a67f2347aa3 100644 --- a/tools/marvin/marvin/cloudstackTestClient.py +++ b/tools/marvin/marvin/cloudstackTestClient.py @@ -16,6 +16,7 @@ import dbConnection from cloudstackAPI import * import random import string +import hashlib class cloudstackTestClient(object): def __init__(self, mgtSvr=None, port=8096, apiKey = None, securityKey = None, asyncTimeout=3600, defaultWorkerThreads=10, logging=None): @@ -67,6 +68,10 @@ class cloudstackTestClient(object): cdomain.name = DomainName domain = self.apiClient.createDomain(cdomain) domId = domain.id + + mdf = hashlib.md5() + mdf.update("password") + mdf_pass = mdf.hexdigest() cmd = listAccounts.listAccountsCmd() cmd.name = UserName @@ -81,7 +86,7 @@ class cloudstackTestClient(object): createAcctCmd.email = "test-" + self.random_gen() + "@citrix.com" createAcctCmd.firstname = UserName createAcctCmd.lastname = UserName - createAcctCmd.password = "password" + createAcctCmd.password = mdf_pass createAcctCmd.username = UserName acct = self.apiClient.createAccount(createAcctCmd) acctId = acct.id diff --git a/tools/testClient/cloudstackTestClient.py b/tools/testClient/cloudstackTestClient.py index eed4de43ce9..f97a8edf779 100644 --- a/tools/testClient/cloudstackTestClient.py +++ b/tools/testClient/cloudstackTestClient.py @@ -4,6 +4,7 @@ import dbConnection from cloudstackAPI import * import random import string +import hashlib class cloudstackTestClient(object): def __init__(self, mgtSvr=None, port=8096, apiKey = None, securityKey = None, asyncTimeout=3600, defaultWorkerThreads=10, logging=None): @@ -56,6 +57,10 @@ class cloudstackTestClient(object): domain = self.apiClient.createDomain(cdomain) domId = domain.id + mdf = hashlib.md5() + mdf.update("password") + mdf_pass = mdf.hexdigest() + cmd = listAccounts.listAccountsCmd() cmd.name = UserName cmd.domainid = domId @@ -69,7 +74,7 @@ class cloudstackTestClient(object): createAcctCmd.email = "test-" + self.random_gen() + "@citrix.com" createAcctCmd.firstname = UserName createAcctCmd.lastname = UserName - createAcctCmd.password = "password" + createAcctCmd.password = mdf_pass createAcctCmd.username = UserName acct = self.apiClient.createAccount(createAcctCmd) acctId = acct.id