Commit 4e4171b6 by Szabolcs Gelencser

Make sure random generated password always fits Azure's needs

parent e70e0f22
......@@ -57,7 +57,7 @@ logger = getLogger(__name__)
def pwgen():
return User.objects.make_random_password()
return User.objects.make_random_password()+"aA1"
class Message(TimeStampedModel, TimeFramedModel):
......
......@@ -147,7 +147,7 @@ class TemplateCreate(SuccessMessageMixin, CreateView):
post['max_ram_size'] = post['ram_size']
req_traits = post.pop("req_traits")
tags = post.pop("tags")
post['pw'] = User.objects.make_random_password()
post['pw'] = User.objects.make_random_password() + "aA1"
post['is_base'] = True
post['azure_template'] = AzureBuiltinVersion.objects.get(
pk=post['azure_template'])
......
......@@ -434,7 +434,7 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
'max_ram_size', 'arch', 'priority', 'boot_menu',
'raw_data', 'lease', 'access_method', 'system',
'has_agent']
params = dict(template=template, owner=owner, pw=pwgen())
params = dict(template=template, owner=owner, pw=pwgen() + "aA1")
params.update([(f, getattr(template, f)) for f in common_fields])
params.update(kwargs) # override defaults w/ user supplied values
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment