Ejemplo n.º 1
0
    def test_reload_neutron_lb(self):
        group = mock.Mock()
        self.patchobject(grouputils, 'get_member_refids',
                         return_value=['ID1', 'ID2', 'ID3'])

        lb1 = self.stack['neutron_lb_1']
        lb2 = self.stack['neutron_lb_2']
        lb1.action = mock.Mock(return_value=lb1.CREATE)
        lb2.action = mock.Mock(return_value=lb2.CREATE)
        lbs = {
            'LB_1': lb1,
            'LB_2': lb2
        }

        lb1.handle_update = mock.Mock()
        lb2.handle_update = mock.Mock()

        prop_diff = {'members': ['ID1', 'ID2', 'ID3']}

        lbutils.reload_loadbalancers(group, lbs)

        # For verification's purpose, we just check the prop_diff
        lb1.handle_update.assert_called_with(mock.ANY, mock.ANY,
                                             prop_diff)
        lb2.handle_update.assert_called_with(mock.ANY, mock.ANY,
                                             prop_diff)
Ejemplo n.º 2
0
    def test_reload_aws_lb(self):
        group = mock.Mock()
        self.patchobject(grouputils,
                         'get_member_refids',
                         return_value=['ID1', 'ID2', 'ID3'])

        lb1 = self.stack['aws_lb_1']
        lb2 = self.stack['aws_lb_2']
        lbs = {'LB_1': lb1, 'LB_2': lb2}

        lb1.handle_update = mock.Mock()
        lb2.handle_update = mock.Mock()
        prop_diff = {'Instances': ['ID1', 'ID2', 'ID3']}

        lbutils.reload_loadbalancers(group, lbs)

        # For verification's purpose, we just check the prop_diff
        lb1.handle_update.assert_called_with(mock.ANY, mock.ANY, prop_diff)
        lb2.handle_update.assert_called_with(mock.ANY, mock.ANY, prop_diff)
Ejemplo n.º 3
0
 def _lb_reload(self, exclude=None):
     lb_names = self.properties.get(self.LOAD_BALANCER_NAMES, None)
     if lb_names:
         lb_dict = dict((name, self.stack[name]) for name in lb_names)
         lbutils.reload_loadbalancers(self, lb_dict, exclude)
 def _lb_reload(self, exclude=None):
     lb_names = self.properties.get(self.LOAD_BALANCER_NAMES, None)
     if lb_names:
         lb_dict = dict((name, self.stack[name]) for name in lb_names)
         lbutils.reload_loadbalancers(self, lb_dict, exclude)