From 666cf187eac933e89a94cd1fd0ca2161918fe623 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Wed, 30 Aug 2017 09:43:54 +0200 Subject: [PATCH] Refactored and added comments --- opennebula_api/models.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/opennebula_api/models.py b/opennebula_api/models.py index a99d8353..0167e000 100644 --- a/opennebula_api/models.py +++ b/opennebula_api/models.py @@ -504,11 +504,16 @@ class OpenNebulaManager(): except ConnectionError: raise - def save_public_key(self, keys): + def manage_public_key(self, keys): """ - A function that saves the supplied keys to the authorized_keys file + A function that manages the supplied keys in the authorized_keys file - :param keys: List of ssh keys that are to be added + :param keys: List of ssh keys that are to be added/removed + A key should be a dict of the form + { + 'value': 'sha-.....', # public key as string + 'state': True # whether key is to be added or + } # removed :return: """ owner = CustomUser.objects.filter(