#NEWLINE# def test_az_scheduler_no_az_hints( self ) : #NEWLINE# #INDENT# cfg . CONF . set_override ( 'dhcp_agents_per_network' , 2 ) #NEWLINE# self . _save_networks ( [ '1111' ] ) #NEWLINE# helpers . register_dhcp_agent ( 'az1-host1' , networks = 2 , az = 'az1' ) #NEWLINE# helpers . register_dhcp_agent ( 'az1-host2' , networks = 3 , az = 'az1' ) #NEWLINE# helpers . register_dhcp_agent ( 'az2-host1' , networks = 2 , az = 'az2' ) #NEWLINE# helpers . register_dhcp_agent ( 'az2-host2' , networks = 1 , az = 'az2' ) #NEWLINE# self . plugin . network_scheduler . schedule ( self . plugin , self . ctx , { #NEWLINE# #INDENT# 'id' : '1111' , #NEWLINE# 'availability_zone_hints' : [ ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# agents = self . plugin . get_dhcp_agents_hosting_networks ( self . ctx , [ '1111' ] ) #NEWLINE# self . assertEqual ( 2 , len ( expected_hosts ) ) #NEWLINE# expected_hosts = set ( [ 'az1-host1' , 'az2-host2' ] ) #NEWLINE# hosts = { a [ 'host' ] for a in agents } #NEWLINE# self . assertEqual ( expected_hosts , hosts )