<s> from oslo_log import log as logging <EOL> from nova . scheduler import filters <EOL> LOG = logging . getLogger ( __name__ ) <EOL> class ExactRamFilter ( filters . BaseHostFilter ) : <EOL> """<STR_LIT>""" <EOL> def host_passes ( self , host_state , spec_obj ) : <EOL> """<STR_LIT>""" <EOL> requested_ram = spec_obj . memory_mb <EOL> if requested_ram != host_state . free_ram_mb : <EOL> LOG . debug ( "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" , <EOL> { '<STR_LIT>' : host_state , <EOL> '<STR_LIT>' : requested_ram , <EOL> '<STR_LIT>' : host_state . free_ram_mb } ) <EOL> return False <EOL> host_state . limits [ '<STR_LIT>' ] = host_state . total_usable_ram_mb <EOL> return True </s>
