def test_get_vips_parent_service(self): self._init_vips() result = [v for v in api_scrooge.get_vips( parent_service_uid=self.vips[0].device.service.uid )] vips_dict = map(self._vip2api, self.vips[0:1]) self.assertEqual(result, vips_dict)
def test_get_vips_load_balancer_type(self): self._init_vips() result = [v for v in api_scrooge.get_vips( load_balancer_type=self.vips[0].load_balancer_type.name )] vips_dict = map(self._vip2api, self.vips[0:1]) self.assertEqual(result, vips_dict)
def vip(today, **kwargs): new = total = 0 for vip_type in settings.VIP_TYPES: try: unknown_service_environment = get_unknown_service_environment( vip_type) except UnknownServiceEnvironmentNotConfiguredError: logger.error( 'Unknown service environment not configured for {}'.format( vip_type)) else: for ralph_vip in api_scrooge.get_vips(load_balancer_type=vip_type): total += 1 if update_vip( ralph_vip, today, unknown_service_environment, ): new += 1 return True, 'VIPs: {0} new, {1} updated, {2} total'.format( new, total - new, total, )
def test_get_vips(self): self._init_vips() result = [v for v in api_scrooge.get_vips()] vips_dict = map(self._vip2api, self.vips) self.assertEqual(result, vips_dict)