def create_load_balancer(self):
     nova.NovaClientPlugin._create().AndReturn(self.fc)
     neutronclient.Client.create_member({
         'member': {
             'pool_id': 'pool123', 'protocol_port': 8080,
             'address': '1.2.3.4'}}
     ).AndReturn({'member': {'id': 'member5678'}})
     snippet = template_format.parse(lb_template)
     stack = utils.parse_stack(snippet)
     resource_defns = stack.t.resource_definitions(stack)
     return loadbalancer.LoadBalancer(
         'lb', resource_defns['lb'], stack)
示例#2
0
 def create_load_balancer(self):
     clients.OpenStackClients.keystone().AndReturn(
         fakes.FakeKeystoneClient())
     clients.OpenStackClients.nova().MultipleTimes().AndReturn(self.fc)
     neutronclient.Client.create_member({
         'member': {
             'pool_id': 'pool123', 'protocol_port': 8080,
             'address': '1.2.3.4'}}
     ).AndReturn({'member': {'id': 'member5678'}})
     snippet = template_format.parse(lb_template)
     stack = utils.parse_stack(snippet)
     resource_defns = stack.t.resource_definitions(stack)
     return loadbalancer.LoadBalancer(
         'lb', resource_defns['lb'], stack)