#NEWLINE# def get_policy( proj_dir , policy ) : #NEWLINE# #INDENT# 'checks whether a policy is defined in the projects fips.yml\n    and returns its bool value, or the default if not defined.\n\n    :param proj_dir:    the project directory\n    :param policy:      the policy string name\n    :returns:           true/false\n    ' #NEWLINE# def_policies = { #NEWLINE# #INDENT# 'no_auto_import' : False , #NEWLINE# #UNINDENT# } #NEWLINE# if util . is_valid_project_dir ( proj_dir ) : #NEWLINE# #INDENT# dic = util . load_fips_yml ( proj_dir ) #NEWLINE# if ( ( 'policies' in dic ) and ( type ( dic [ 'policies' ] ) is dict ) ) : #NEWLINE# #INDENT# if ( policy in dic [ 'policies' ] ) : #NEWLINE# #INDENT# return dic [ 'policies' ] [ policy ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( dic in def_policies ) : #NEWLINE# #INDENT# return def_policies [ policy ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# log . error ( "unknown policy name: '{}'" . format ( policy ) ) #NEWLINE# return None