Skip to content

Commit

Permalink
check if mysecretdict is dict
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandredevely committed Apr 12, 2024
1 parent 7daa385 commit e92816d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions oc/od/orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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


Expand Down

0 comments on commit e92816d

Please sign in to comment.