From e92816d5f4d8f8286001f531cb6f333370c76002 Mon Sep 17 00:00:00 2001 From: alexandredevely <12896316+alexandredevely@users.noreply.github.com> Date: Fri, 12 Apr 2024 10:10:12 +0200 Subject: [PATCH] check if mysecretdict is dict --- oc/od/orchestrator.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/oc/od/orchestrator.py b/oc/od/orchestrator.py index c443cd7..eed0990 100755 --- a/oc/od/orchestrator.py +++ b/oc/od/orchestrator.py @@ -996,6 +996,10 @@ def build_volumes_secrets( self, authinfo:AuthInfo, userinfo:AuthUser, volume_ty # self.logger.debug(f"checking {secret_auth_name} access_type='auth'") + if not isinstance(mysecretdict[secret_auth_name], dict): + self.logger.error(f"skipping secret {secret_auth_name} is not a dict") + continue + # only mount secrets_requirement if 'all' not in secrets_requirement: if mysecretdict[secret_auth_name]['type'] not in secrets_requirement: @@ -1329,11 +1333,11 @@ def build_volumes_vnc( self, authinfo:AuthInfo, userinfo:AuthUser, volume_type, def get_volumes_localaccount_name( self, authinfo:AuthInfo, userinfo:AuthUser )->str: - """_summary_ + """get_volumes_localaccount_name Args: - authinfo (AuthInfo): _description_ - userinfo (AuthUser): _description_ + authinfo (AuthInfo): AuthInfo + userinfo (AuthUser): AuthUser Returns: str: return the name of the localaccount volume same as secret @@ -1345,7 +1349,7 @@ def get_volumes_localaccount_name( self, authinfo:AuthInfo, userinfo:AuthUser )- localaccount_name = None mysecretdict = self.list_dict_secret_data( authinfo, userinfo, access_type='localaccount' ) if isinstance(mysecretdict, dict ) and len(mysecretdict)>0: - localaccount_name = list( mysecretdict.keys() )[0] # should be only one + localaccount_name = list( mysecretdict.keys() )[0] # should be only one, get the first one return localaccount_name