From eda766dc6c215a4eda16a368d2c1b8d37fce8e50 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 14 Dec 2019 19:19:23 +0530 Subject: [PATCH] Check if we get correct opennebula user id --- opennebula_api/models.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/opennebula_api/models.py b/opennebula_api/models.py index f8ef6481..31b8955d 100644 --- a/opennebula_api/models.py +++ b/opennebula_api/models.py @@ -485,11 +485,17 @@ class OpenNebulaManager(): ) def change_user_password(self, passwd_hash): - self.oneadmin_client.call( - oca.User.METHODS['passwd'], - self.opennebula_user.id, - passwd_hash - ) + if type(self.opennebula_user) == int: + logger.debug("opennebula_user is int and has value = %s" % + self.opennebula_user) + else: + logger.debug("opennebula_user is object and corresponding id is %s" + % self.opennebula_user.id) + # self.oneadmin_client.call( + # oca.User.METHODS['passwd'], + # self.opennebula_user if type(self.opennebula_user) == int else self.opennebula_user.id, + # passwd_hash + # ) def add_public_key(self, user, public_key='', merge=False): """