From e7c334924df96a615d3e12ab9b6bb8a88607ed5f Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 12 May 2019 19:55:24 +0200 Subject: [PATCH] Make update_type a parameter with 1 as default 0: Replace the template 1: Merge the new template --- opennebula_api/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/opennebula_api/models.py b/opennebula_api/models.py index 3a74ad63..7348d538 100644 --- a/opennebula_api/models.py +++ b/opennebula_api/models.py @@ -421,21 +421,22 @@ class OpenNebulaManager(): return return_value - def save_key_in_opennebula_user(self, ssh_key): + def save_key_in_opennebula_user(self, ssh_key, update_type=1): """ Save the given ssh key in OpenNebula user # Update type: 0: Replace the whole template. 1: Merge new template with the existing one. :param ssh_key: The ssh key to be saved + :param update_type: The update type as explained above + :return: """ - UPDATE_TYPE = 1 return_value = self.client.call( 'user.update', self.opennebula_user.id, '%s' % ssh_key, - UPDATE_TYPE + update_type ) if type(return_value) == int: logger.debug(