예제 #1
0
 def create_load_balancer(self, extra_create_mocks=[]):
     nova.NovaClientPlugin.client.return_value = self.fc
     results = [{'member': {'id': 'member5678'}}]
     for m in extra_create_mocks:
         results.append(m)
     self.mc.create_member.side_effect = results
     snippet = template_format.parse(lb_template)
     self.stack = utils.parse_stack(snippet)
     resource_defns = self.stack.t.resource_definitions(self.stack)
     return loadbalancer.LoadBalancer('lb', resource_defns['lb'],
                                      self.stack)
예제 #2
0
 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)
     self.stack = utils.parse_stack(snippet)
     resource_defns = self.stack.t.resource_definitions(self.stack)
     return loadbalancer.LoadBalancer(
         'lb', resource_defns['lb'], self.stack)