def _handle_pool_addrange(self, *args, **options): range_from = options['ip_start'].decode('utf-8') range_to = options['ip_end'].decode('utf-8') IPAddressPoolFactory.from_range(range_from=range_from, range_to=range_to) self._list_pools()
def test_create_from_range(self): pool1 = IPAddressPoolFactory.from_range('46.17.40.50', '46.17.40.192') self.assertEqual(143, pool1.get_ips().count()) self.assertEqual(143, pool1.get_free_ips().count()) self.assertEqual('46.17.40.50-46.17.40.192', pool1.name)