parameters: (_, rolename: Optional[str] = None)
return_statement: return 0, json.dumps(role.to_dict()), ''
docstring: Show role info
docstring_summary: Show role info
docstring_tokens: Show role info
function: def ac_role_show_cmd(_, rolename: Optional[str] = None):
      '''
      Show role info
      '''
      if not rolename:
          roles = dict(mgr.ACCESS_CTRL_DB.roles)
          roles.update(SYSTEM_ROLES)
          roles_list = [name for name, _ in roles.items()]
          return 0, json.dumps(roles_list), ''
      try:
          role = mgr.ACCESS_CTRL_DB.get_role(rolename)
      except RoleDoesNotExist as ex:
          if rolename not in SYSTEM_ROLES:
              return -errno.ENOENT, '', str(ex)
          role = SYSTEM_ROLES[rolename]
      return 0, json.dumps(role.to_dict()), ''
function_tokens: def ac_role_show_cmd ( _ , rolename : Optional [ str ] = None ) : if not rolename : roles = dict ( mgr . ACCESS_CTRL_DB . roles ) roles . update ( SYSTEM_ROLES ) roles_list = [ name for name , _ in roles . items ( ) ] return 0 , json . dumps ( roles_list ) , '' try : role = mgr . ACCESS_CTRL_DB . get_role ( rolename ) except RoleDoesNotExist as ex : if rolename not in SYSTEM_ROLES : return - errno . ENOENT , '' , str ( ex ) role = SYSTEM_ROLES [ rolename ] return 0 , json . dumps ( role . to_dict ( ) ) , ''