mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-7255: Fixed marvin issue related to creating random account usernames
Signed-off-by: Santhosh Edukulla <santhosh.edukulla@gmail.com>
This commit is contained in:
parent
c38a15f6e8
commit
0a7af329f5
@ -104,11 +104,13 @@ class Account:
|
||||
cmd.lastname = services["lastname"]
|
||||
|
||||
cmd.password = services["password"]
|
||||
|
||||
username = "-".join([services["username"],
|
||||
random_gen(id=apiclient.id)])
|
||||
# Trim username to 99 characters to prevent failure
|
||||
cmd.username = username[:99] if len(username) > 99 else username
|
||||
username = services["username"]
|
||||
# Limit account username to 99 chars to avoid failure
|
||||
# 6 chars start string + 85 chars apiclientid + 6 chars random string + 2 chars joining hyphen string = 99
|
||||
username = username[:6]
|
||||
apiclientid = apiclient.id[-85:] if len(apiclient.id) > 85 else apiclient.id
|
||||
cmd.username = "-".join([username,
|
||||
random_gen(id=apiclientid, size=6)])
|
||||
|
||||
if "accountUUID" in services:
|
||||
cmd.accountid = "-".join([services["accountUUID"], random_gen()])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user