def direct_mode_cluster_role_env(cluster_role_env, config_path):
<EOL>cli_conf_file = os.path.join(config_path, CLIENT_YAML)<EOL>if not os.path.isfile(cli_conf_file):<EOL><INDENT>return True<EOL><DEDENT>client_confs = {}<EOL>with open(cli_conf_file, '<STR_LIT:r>') as conf_file:<EOL><INDENT>client_confs = yaml.load(conf_file)<EOL>if not client_confs:<EOL><INDENT>return True<EOL><DEDENT>role_present = True if len(cluster_role_env[<NUM_LIT:1>]) > <NUM_LIT:0> else False<EOL>if ROLE_REQUIRED in client_confs and client_confs[ROLE_REQUIRED] and not role_present:<EOL><INDENT>raise Exception("<STR_LIT>"<EOL>% (cluster_role_env, ROLE_REQUIRED, cli_conf_file))<EOL><DEDENT>environ_present = True if len(cluster_role_env[<NUM_LIT:2>]) > <NUM_LIT:0> else False<EOL>if ENV_REQUIRED in client_confs and client_confs[ENV_REQUIRED] and not environ_present:<EOL><INDENT>raise Exception("<STR_LIT>"<EOL>% (cluster_role_env, ENV_REQUIRED, cli_conf_file))<EOL><DEDENT><DEDENT>return True<EOL>
Check cluster/[role]/[environ], if they are required