#NEWLINE# def _prepare_policy( self ) : #NEWLINE# #INDENT# policy = jsonutils . load ( open ( CONF . oslo_policy . policy_file ) ) #NEWLINE# for ( action , rule ) in six . iteritems ( policy ) : #NEWLINE# #INDENT# policy [ action ] = ( 'role:%s' % self . role ) #NEWLINE# #UNINDENT# self . policy_dir = self . useFixture ( fixtures . TempDir ( ) ) #NEWLINE# self . policy_file = os . path . join ( self . policy_dir . path , 'policy.json' ) #NEWLINE# with open ( self . policy_file , 'w' ) as f : #NEWLINE# #INDENT# jsonutils . dump ( policy , f )