commit
d2d62bf990
3 changed files with 8 additions and 2 deletions
|
@ -27,3 +27,7 @@
|
||||||
* [datacenterlight] Fix initially shown price
|
* [datacenterlight] Fix initially shown price
|
||||||
1.0.0: 2017-05-25
|
1.0.0: 2017-05-25
|
||||||
* Initial stable release
|
* Initial stable release
|
||||||
|
|
||||||
|
Next:
|
||||||
|
[datacenterlight] Fixed error trying to delete ssh key
|
||||||
|
[datacenterlight] Fixed footer links
|
||||||
|
|
|
@ -369,7 +369,7 @@ class SSHKeyCreateView(LoginRequiredMixin, FormView):
|
||||||
manager = OpenNebulaManager()
|
manager = OpenNebulaManager()
|
||||||
|
|
||||||
# Get user ssh key
|
# Get user ssh key
|
||||||
public_key = form.cleaned_data.get('public_key')
|
public_key = form.cleaned_data.get('public_key', '').decode('utf-8')
|
||||||
# Add ssh key to user
|
# Add ssh key to user
|
||||||
try:
|
try:
|
||||||
manager.add_public_key(user=owner, public_key=public_key, merge=True)
|
manager.add_public_key(user=owner, public_key=public_key, merge=True)
|
||||||
|
|
|
@ -449,6 +449,7 @@ class OpenNebulaManager():
|
||||||
"""
|
"""
|
||||||
# TODO: Check if we can remove this first try because we basically just
|
# TODO: Check if we can remove this first try because we basically just
|
||||||
# raise the possible Errors
|
# raise the possible Errors
|
||||||
|
|
||||||
try:
|
try:
|
||||||
open_user = self._get_user(user)
|
open_user = self._get_user(user)
|
||||||
try:
|
try:
|
||||||
|
@ -492,7 +493,8 @@ class OpenNebulaManager():
|
||||||
try:
|
try:
|
||||||
old_key = open_user.template.ssh_public_key
|
old_key = open_user.template.ssh_public_key
|
||||||
if public_key not in old_key:
|
if public_key not in old_key:
|
||||||
raise KeyDoesNotExistsError()
|
return False
|
||||||
|
# raise KeyDoesNotExistsError()
|
||||||
if '\n{}'.format(public_key) in old_key:
|
if '\n{}'.format(public_key) in old_key:
|
||||||
public_key = old_key.replace('\n{}'.format(public_key), '')
|
public_key = old_key.replace('\n{}'.format(public_key), '')
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue