Force user to generate ssh key in order to create a VM #3147. As user I want to terminate a VM using web interface #3148. Change password in opennebula when user change his password on hosting app #3149
This commit is contained in:
parent
1a6e1a44d8
commit
3873540849
7 changed files with 214 additions and 43 deletions
|
|
@ -101,7 +101,9 @@ class UserHostingKeyForm(forms.ModelForm):
|
|||
# print(self.fields)
|
||||
|
||||
def clean_name(self):
|
||||
return ''.join(random.choice(string.ascii_lowercase) for i in range(7))
|
||||
return "dcl-priv-key-%s" % (
|
||||
''.join(random.choice(string.ascii_lowercase) for i in range(7))
|
||||
)
|
||||
|
||||
def clean_user(self):
|
||||
return self.request.user
|
||||
|
|
@ -109,8 +111,6 @@ class UserHostingKeyForm(forms.ModelForm):
|
|||
def clean(self):
|
||||
cleaned_data = self.cleaned_data
|
||||
|
||||
print(cleaned_data)
|
||||
|
||||
if not cleaned_data.get('public_key'):
|
||||
private_key, public_key = UserHostingKey.generate_keys()
|
||||
cleaned_data.update({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue