284
283
self.mox.StubOutWithMock(db, 'network_get')
285
284
self.mox.StubOutWithMock(db, 'network_update')
286
285
self.mox.StubOutWithMock(db, 'fixed_ip_associate_pool')
286
self.mox.StubOutWithMock(db, 'instance_get')
287
287
self.mox.StubOutWithMock(db,
288
288
'virtual_interface_get_by_instance_and_network')
289
289
self.mox.StubOutWithMock(db, 'fixed_ip_update')
290
self.mox.StubOutWithMock(quota.QUOTAS, 'reserve')
291
self.mox.StubOutWithMock(db, 'instance_get_by_uuid')
292
self.mox.StubOutWithMock(self.network, 'get_instance_nw_info')
291
db.fixed_ip_update(mox.IgnoreArg(),
294
db.virtual_interface_get_by_instance_and_network(mox.IgnoreArg(),
295
mox.IgnoreArg(), mox.IgnoreArg()).AndReturn({'id': 0})
297
db.instance_get(self.context,
298
1).AndReturn({'display_name': HOST,
299
'uuid': 'test-00001'})
300
db.instance_get(mox.IgnoreArg(),
301
mox.IgnoreArg()).AndReturn({'security_groups':
303
db.instance_get(mox.IgnoreArg(),
304
mox.IgnoreArg()).AndReturn({'security_groups':
305
[{'id':0, 'name':'test'}]})
294
306
db.fixed_ip_associate_pool(mox.IgnoreArg(),
296
308
mox.IgnoreArg()).AndReturn('192.168.0.101')
298
db.instance_get_by_uuid(mox.IgnoreArg(),
299
mox.IgnoreArg()).AndReturn({'security_groups':
301
db.instance_get_by_uuid(mox.IgnoreArg(),
302
mox.IgnoreArg()).AndReturn({'security_groups':
303
[{'id': 0, 'name': 'test'}]})
305
db.virtual_interface_get_by_instance_and_network(mox.IgnoreArg(),
306
mox.IgnoreArg(), mox.IgnoreArg()).AndReturn({'id': 0})
308
db.fixed_ip_update(mox.IgnoreArg(),
312
quota.QUOTAS.reserve(mox.IgnoreArg(),
313
fixed_ips=mox.IgnoreArg()).AndReturn(None)
315
db.instance_get_by_uuid(self.context,
316
mox.IgnoreArg()).AndReturn({'display_name': HOST})
318
309
db.network_get(mox.IgnoreArg(),
320
311
project_only=mox.IgnoreArg()).AndReturn(networks[0])
321
312
db.network_update(mox.IgnoreArg(), mox.IgnoreArg(), mox.IgnoreArg())
323
self.network.get_instance_nw_info(mox.IgnoreArg(), mox.IgnoreArg(),
324
mox.IgnoreArg(), mox.IgnoreArg())
325
313
self.mox.ReplayAll()
326
self.network.add_fixed_ip_to_instance(self.context, FAKEUUID, HOST,
314
self.network.add_fixed_ip_to_instance(self.context, 1, HOST,
327
315
networks[0]['id'])
329
317
def test_add_fixed_ip_instance_using_uuid_without_vpn(self):
330
318
self.mox.StubOutWithMock(db, 'network_get_by_uuid')
331
319
self.mox.StubOutWithMock(db, 'network_update')
332
320
self.mox.StubOutWithMock(db, 'fixed_ip_associate_pool')
321
self.mox.StubOutWithMock(db, 'instance_get')
333
322
self.mox.StubOutWithMock(db,
334
323
'virtual_interface_get_by_instance_and_network')
335
324
self.mox.StubOutWithMock(db, 'fixed_ip_update')
336
self.mox.StubOutWithMock(quota.QUOTAS, 'reserve')
337
self.mox.StubOutWithMock(db, 'instance_get_by_uuid')
338
self.mox.StubOutWithMock(self.network, 'get_instance_nw_info')
326
db.fixed_ip_update(mox.IgnoreArg(),
329
db.virtual_interface_get_by_instance_and_network(mox.IgnoreArg(),
330
mox.IgnoreArg(), mox.IgnoreArg()).AndReturn({'id': 0})
332
db.instance_get(self.context,
333
1).AndReturn({'display_name': HOST,
334
'uuid': 'test-00001'})
335
db.instance_get(mox.IgnoreArg(),
336
mox.IgnoreArg()).AndReturn({'security_groups':
338
db.instance_get(mox.IgnoreArg(),
339
mox.IgnoreArg()).AndReturn({'security_groups':
340
[{'id':0, 'name':'test'}]})
340
342
db.fixed_ip_associate_pool(mox.IgnoreArg(),
342
344
mox.IgnoreArg()).AndReturn('192.168.0.101')
344
db.instance_get_by_uuid(mox.IgnoreArg(),
345
mox.IgnoreArg()).AndReturn({'security_groups':
347
db.instance_get_by_uuid(mox.IgnoreArg(),
348
mox.IgnoreArg()).AndReturn({'security_groups':
349
[{'id': 0, 'name': 'test'}]})
351
db.virtual_interface_get_by_instance_and_network(mox.IgnoreArg(),
352
mox.IgnoreArg(), mox.IgnoreArg()).AndReturn({'id': 0})
354
db.fixed_ip_update(mox.IgnoreArg(),
358
quota.QUOTAS.reserve(mox.IgnoreArg(),
359
fixed_ips=mox.IgnoreArg()).AndReturn(None)
361
db.instance_get_by_uuid(self.context,
362
mox.IgnoreArg()).AndReturn({'display_name': HOST})
364
345
db.network_get_by_uuid(mox.IgnoreArg(),
365
346
mox.IgnoreArg()).AndReturn(networks[0])
366
347
db.network_update(mox.IgnoreArg(), mox.IgnoreArg(), mox.IgnoreArg())
368
self.network.get_instance_nw_info(mox.IgnoreArg(), mox.IgnoreArg(),
369
mox.IgnoreArg(), mox.IgnoreArg())
370
348
self.mox.ReplayAll()
371
self.network.add_fixed_ip_to_instance(self.context, FAKEUUID, HOST,
349
self.network.add_fixed_ip_to_instance(self.context, 1, HOST,
372
350
networks[0]['uuid'])
374
352
def test_mini_dns_driver(self):
418
396
def test_instance_dns(self):
419
397
fixedip = '192.168.0.101'
420
self.mox.StubOutWithMock(db, 'network_get_by_uuid')
398
self.mox.StubOutWithMock(db, 'network_get')
421
399
self.mox.StubOutWithMock(db, 'network_update')
422
400
self.mox.StubOutWithMock(db, 'fixed_ip_associate_pool')
401
self.mox.StubOutWithMock(db, 'instance_get')
402
self.mox.StubOutWithMock(db, 'instance_get_by_uuid')
423
403
self.mox.StubOutWithMock(db,
424
404
'virtual_interface_get_by_instance_and_network')
425
405
self.mox.StubOutWithMock(db, 'fixed_ip_update')
426
self.mox.StubOutWithMock(db, 'instance_get_by_uuid')
427
self.mox.StubOutWithMock(self.network, 'get_instance_nw_info')
428
self.mox.StubOutWithMock(quota.QUOTAS, 'reserve')
407
db.fixed_ip_update(mox.IgnoreArg(),
410
db.virtual_interface_get_by_instance_and_network(mox.IgnoreArg(),
411
mox.IgnoreArg(), mox.IgnoreArg()).AndReturn({'id': 0})
413
db.instance_get(self.context,
414
1).AndReturn({'display_name': HOST,
415
'uuid': 'test-00001'})
416
db.instance_get(mox.IgnoreArg(),
417
mox.IgnoreArg()).AndReturn({'security_groups':
419
db.instance_get(mox.IgnoreArg(),
420
mox.IgnoreArg()).AndReturn({'security_groups':
421
[{'id':0, 'name':'test'}]})
430
423
db.fixed_ip_associate_pool(mox.IgnoreArg(),
432
425
mox.IgnoreArg()).AndReturn(fixedip)
434
db.instance_get_by_uuid(mox.IgnoreArg(),
435
mox.IgnoreArg()).AndReturn({'security_groups':
437
db.instance_get_by_uuid(mox.IgnoreArg(),
438
mox.IgnoreArg()).AndReturn({'security_groups':
439
[{'id': 0, 'name': 'test'}]})
441
db.virtual_interface_get_by_instance_and_network(mox.IgnoreArg(),
442
mox.IgnoreArg(), mox.IgnoreArg()).AndReturn({'id': 0})
444
db.fixed_ip_update(mox.IgnoreArg(),
448
quota.QUOTAS.reserve(mox.IgnoreArg(),
449
fixed_ips=mox.IgnoreArg()).AndReturn(None)
451
db.instance_get_by_uuid(self.context,
452
mox.IgnoreArg()).AndReturn({'display_name': HOST})
454
db.network_get_by_uuid(mox.IgnoreArg(),
455
mox.IgnoreArg()).AndReturn(networks[0])
426
db.network_get(mox.IgnoreArg(),
428
project_only=mox.IgnoreArg()).AndReturn(networks[0])
456
429
db.network_update(mox.IgnoreArg(), mox.IgnoreArg(), mox.IgnoreArg())
458
self.network.get_instance_nw_info(mox.IgnoreArg(), mox.IgnoreArg(),
459
mox.IgnoreArg(), mox.IgnoreArg())
460
431
self.mox.ReplayAll()
461
self.network.add_fixed_ip_to_instance(self.context, FAKEUUID, HOST,
432
self.network.add_fixed_ip_to_instance(self.context, 1, HOST,
464
434
instance_manager = self.network.instance_dns_manager
465
435
addresses = instance_manager.get_entries_by_name(HOST,
466
436
self.network.instance_dns_domain)
467
437
self.assertEqual(len(addresses), 1)
468
438
self.assertEqual(addresses[0], fixedip)
469
addresses = instance_manager.get_entries_by_name(FAKEUUID,
439
addresses = instance_manager.get_entries_by_name('test-00001',
470
440
self.network.instance_dns_domain)
471
441
self.assertEqual(len(addresses), 1)
472
442
self.assertEqual(addresses[0], fixedip)
474
def test_allocate_floating_ip(self):
475
self.assertEqual(self.network.allocate_floating_ip(self.context,
478
def test_deallocate_floating_ip(self):
479
self.assertEqual(self.network.deallocate_floating_ip(self.context,
482
def test_associate_floating_ip(self):
483
self.assertEqual(self.network.associate_floating_ip(self.context,
486
def test_disassociate_floating_ip(self):
487
self.assertEqual(self.network.disassociate_floating_ip(self.context,
492
445
class VlanNetworkTestCase(test.TestCase):
998
913
def test_add_fixed_ip_instance_without_vpn_requested_networks(self):
999
914
self.mox.StubOutWithMock(db, 'network_get')
1000
915
self.mox.StubOutWithMock(db, 'fixed_ip_associate_pool')
916
self.mox.StubOutWithMock(db, 'instance_get')
1001
917
self.mox.StubOutWithMock(db,
1002
918
'virtual_interface_get_by_instance_and_network')
1003
919
self.mox.StubOutWithMock(db, 'fixed_ip_update')
1004
self.mox.StubOutWithMock(db, 'instance_get_by_uuid')
1005
self.mox.StubOutWithMock(self.network, 'get_instance_nw_info')
921
db.instance_get(mox.IgnoreArg(),
922
mox.IgnoreArg()).AndReturn({'uuid': FAKEUUID,
923
'display_name': HOST})
1007
924
db.fixed_ip_update(mox.IgnoreArg(),
1008
925
mox.IgnoreArg(),
1009
926
mox.IgnoreArg())
1010
927
db.virtual_interface_get_by_instance_and_network(mox.IgnoreArg(),
1011
928
mox.IgnoreArg(), mox.IgnoreArg()).AndReturn({'id': 0})
1013
db.instance_get_by_uuid(mox.IgnoreArg(),
1014
mox.IgnoreArg()).AndReturn({'security_groups': [{'id': 0}],
1015
'availability_zone': '',
930
db.instance_get(mox.IgnoreArg(),
931
mox.IgnoreArg()).AndReturn({'security_groups':
933
'availability_zone': '',
1017
935
db.fixed_ip_associate_pool(mox.IgnoreArg(),
1018
936
mox.IgnoreArg(),
1019
937
mox.IgnoreArg()).AndReturn('192.168.0.101')
1020
938
db.network_get(mox.IgnoreArg(),
1021
939
mox.IgnoreArg(),
1022
940
project_only=mox.IgnoreArg()).AndReturn(networks[0])
1023
db.instance_get_by_uuid(mox.IgnoreArg(),
1024
mox.IgnoreArg()).AndReturn({'display_name': HOST})
1025
self.network.get_instance_nw_info(mox.IgnoreArg(), mox.IgnoreArg(),
1026
mox.IgnoreArg(), mox.IgnoreArg())
1027
941
self.mox.ReplayAll()
1028
self.network.add_fixed_ip_to_instance(self.context, FAKEUUID, HOST,
942
self.network.add_fixed_ip_to_instance(self.context, 1, HOST,
1029
943
networks[0]['id'])
1031
945
def test_ip_association_and_allocation_of_other_project(self):
1618
1531
self.assertRaises(exception.NetworkNotFound,
1619
1532
manager.disassociate_network, fake_context, uuid)
1621
def _test_init_host_static_fixed_range(self, net_manager):
1622
self.flags(fake_network=True,
1623
fixed_range='10.0.0.0/22',
1624
routing_source_ip='192.168.0.1',
1625
metadata_host='192.168.0.1',
1626
public_interface='eth1',
1627
dmz_cidr=['10.0.3.0/24'])
1628
binary_name = linux_net.get_binary_name()
1630
# Stub out calls we don't want to really run
1631
self.stubs.Set(linux_net.iptables_manager, '_apply', lambda: None)
1632
self.stubs.Set(floating_ips.FloatingIP, 'init_host_floating_ips',
1635
# Call the network manager init code to configure the fixed_range
1636
net_manager.init_host()
1638
# Get the iptables rules that got created
1640
new_lines = linux_net.iptables_manager._modify_rules(current_lines,
1641
linux_net.iptables_manager.ipv4['nat'],
1644
# The expected rules that should be configured based on the fixed_range
1645
expected_lines = ['[0:0] -A %s-snat -s %s -j SNAT --to-source %s -o %s'
1646
% (binary_name, CONF.fixed_range,
1647
CONF.routing_source_ip,
1648
CONF.public_interface),
1649
'[0:0] -A %s-POSTROUTING -s %s -d %s/32 -j ACCEPT'
1650
% (binary_name, CONF.fixed_range,
1651
CONF.metadata_host),
1652
'[0:0] -A %s-POSTROUTING -s %s -d %s -j ACCEPT'
1653
% (binary_name, CONF.fixed_range, CONF.dmz_cidr[0]),
1654
'[0:0] -A %s-POSTROUTING -s %s -d %s -m conntrack ! '
1655
'--ctstate DNAT -j ACCEPT' % (binary_name,
1659
# Finally, compare the expected rules against the actual ones
1660
for line in expected_lines:
1661
self.assertTrue(line in new_lines)
1663
def _test_init_host_dynamic_fixed_range(self, net_manager):
1664
self.flags(fake_network=True,
1666
routing_source_ip='172.16.0.1',
1667
metadata_host='172.16.0.1',
1668
public_interface='eth1',
1669
dmz_cidr=['10.0.3.0/24'])
1670
binary_name = linux_net.get_binary_name()
1672
# Stub out calls we don't want to really run, mock the db
1673
self.stubs.Set(linux_net.iptables_manager, '_apply', lambda: None)
1674
self.stubs.Set(floating_ips.FloatingIP, 'init_host_floating_ips',
1676
self.stubs.Set(net_manager.l3driver, 'initialize_gateway',
1678
self.mox.StubOutWithMock(db, 'network_get_all_by_host')
1679
db.network_get_all_by_host(mox.IgnoreArg(),
1680
mox.IgnoreArg()).MultipleTimes().AndReturn(networks)
1681
self.mox.ReplayAll()
1683
# Call the network manager init code to configure the fixed_range
1684
net_manager.init_host()
1686
# Get the iptables rules that got created
1688
new_lines = linux_net.iptables_manager._modify_rules(current_lines,
1689
linux_net.iptables_manager.ipv4['nat'],
1692
# The expected rules that should be configured based on the fixed_range
1693
expected_lines = ['[0:0] -A %s-snat -s %s -j SNAT --to-source %s -o %s'
1694
% (binary_name, networks[0]['cidr'],
1695
CONF.routing_source_ip,
1696
CONF.public_interface),
1697
'[0:0] -A %s-POSTROUTING -s %s -d %s/32 -j ACCEPT'
1698
% (binary_name, networks[0]['cidr'],
1699
CONF.metadata_host),
1700
'[0:0] -A %s-POSTROUTING -s %s -d %s -j ACCEPT'
1701
% (binary_name, networks[0]['cidr'],
1703
'[0:0] -A %s-POSTROUTING -s %s -d %s -m conntrack ! '
1704
'--ctstate DNAT -j ACCEPT' % (binary_name,
1705
networks[0]['cidr'],
1706
networks[0]['cidr']),
1707
'[0:0] -A %s-snat -s %s -j SNAT --to-source %s -o %s'
1708
% (binary_name, networks[1]['cidr'],
1709
CONF.routing_source_ip,
1710
CONF.public_interface),
1711
'[0:0] -A %s-POSTROUTING -s %s -d %s/32 -j ACCEPT'
1712
% (binary_name, networks[1]['cidr'],
1713
CONF.metadata_host),
1714
'[0:0] -A %s-POSTROUTING -s %s -d %s -j ACCEPT'
1715
% (binary_name, networks[1]['cidr'],
1717
'[0:0] -A %s-POSTROUTING -s %s -d %s -m conntrack ! '
1718
'--ctstate DNAT -j ACCEPT' % (binary_name,
1719
networks[1]['cidr'],
1720
networks[1]['cidr'])]
1722
# Compare the expected rules against the actual ones
1723
for line in expected_lines:
1724
self.assertTrue(line in new_lines)
1726
# Add an additional network and ensure the rules get configured
1727
new_network = {'id': 2,
1728
'uuid': 'cccccccc-cccc-cccc-cccc-cccccccc',
1731
'multi_host': False,
1732
'cidr': '192.168.2.0/24',
1733
'cidr_v6': '2001:dba::/64',
1734
'gateway_v6': '2001:dba::1',
1736
'netmask': '255.255.255.0',
1738
'bridge_interface': 'fake_fa1',
1739
'gateway': '192.168.2.1',
1740
'broadcast': '192.168.2.255',
1741
'dns1': '192.168.2.1',
1742
'dns2': '192.168.2.2',
1745
'project_id': 'fake_project',
1746
'vpn_public_address': '192.168.2.2',
1747
'vpn_public_port': '22',
1748
'vpn_private_address': '10.0.0.2'}
1750
# Call the network manager init code to configure the fixed_range
1751
ctxt = context.get_admin_context()
1752
net_manager._setup_network_on_host(ctxt, new_network)
1754
# Get the new iptables rules that got created from adding a new network
1756
new_lines = linux_net.iptables_manager._modify_rules(current_lines,
1757
linux_net.iptables_manager.ipv4['nat'],
1760
# Add the new expected rules to the old ones
1761
expected_lines += ['[0:0] -A %s-snat -s %s -j SNAT --to-source %s -o '
1762
'%s' % (binary_name, new_network['cidr'],
1763
CONF.routing_source_ip,
1764
CONF.public_interface),
1765
'[0:0] -A %s-POSTROUTING -s %s -d %s/32 -j ACCEPT'
1766
% (binary_name, new_network['cidr'],
1767
CONF.metadata_host),
1768
'[0:0] -A %s-POSTROUTING -s %s -d %s -j ACCEPT'
1769
% (binary_name, new_network['cidr'],
1771
'[0:0] -A %s-POSTROUTING -s %s -d %s -m conntrack '
1772
'! --ctstate DNAT -j ACCEPT' % (binary_name,
1773
new_network['cidr'],
1774
new_network['cidr'])]
1776
# Compare the expected rules (with new network) against the actual ones
1777
for line in expected_lines:
1778
self.assertTrue(line in new_lines)
1780
def test_flatdhcpmanager_static_fixed_range(self):
1781
"""Test FlatDHCPManager NAT rules for fixed_range."""
1782
# Set the network manager
1783
self.network = network_manager.FlatDHCPManager(host=HOST)
1784
self.network.db = db
1786
# Test existing behavior:
1787
# CONF.fixed_range is set, NAT based on CONF.fixed_range
1788
self._test_init_host_static_fixed_range(self.network)
1790
def test_flatdhcpmanager_dynamic_fixed_range(self):
1791
"""Test FlatDHCPManager NAT rules for fixed_range."""
1792
# Set the network manager
1793
self.network = network_manager.FlatDHCPManager(host=HOST)
1794
self.network.db = db
1796
# Test new behavior:
1797
# CONF.fixed_range is not set, defaults to None
1798
# Determine networks to NAT based on lookup
1799
self._test_init_host_dynamic_fixed_range(self.network)
1801
def test_vlanmanager_static_fixed_range(self):
1802
"""Test VlanManager NAT rules for fixed_range."""
1803
# Set the network manager
1804
self.network = network_manager.VlanManager(host=HOST)
1805
self.network.db = db
1807
# Test existing behavior:
1808
# CONF.fixed_range is set, NAT based on CONF.fixed_range
1809
self._test_init_host_static_fixed_range(self.network)
1811
def test_vlanmanager_dynamic_fixed_range(self):
1812
"""Test VlanManager NAT rules for fixed_range."""
1813
# Set the network manager
1814
self.network = network_manager.VlanManager(host=HOST)
1815
self.network.db = db
1817
# Test new behavior:
1818
# CONF.fixed_range is not set, defaults to None
1819
# Determine networks to NAT based on lookup
1820
self._test_init_host_dynamic_fixed_range(self.network)
1823
1535
class TestRPCFixedManager(network_manager.RPCAllocateFixedIP,
1824
1536
network_manager.NetworkManager):
1825
"""Dummy manager that implements RPCAllocateFixedIP."""
1537
"""Dummy manager that implements RPCAllocateFixedIP"""
1828
1540
class RPCAllocateTestCase(test.TestCase):
1829
"""Tests nova.network.manager.RPCAllocateFixedIP."""
1541
"""Tests nova.network.manager.RPCAllocateFixedIP"""
1830
1542
def setUp(self):
1831
1543
super(RPCAllocateTestCase, self).setUp()
1832
1544
self.rpc_fixed = TestRPCFixedManager()
1913
1622
host=self.network.host,
1914
1623
project_id=project_id)
1916
def test_allocate_for_instance_with_mac(self):
1917
available_macs = set(['ca:fe:de:ad:be:ef'])
1918
inst = db.instance_create(self.context, {'host': self.compute.host,
1919
'display_name': HOST,
1920
'instance_type_id': 1})
1921
networks = db.network_get_all(self.context)
1922
for network in networks:
1923
db.network_update(self.context, network['id'],
1924
{'host': self.network.host})
1925
project_id = self.context.project_id
1926
nw_info = self.network.allocate_for_instance(self.context,
1927
instance_id=inst['id'], instance_uuid=inst['uuid'],
1928
host=inst['host'], vpn=None, rxtx_factor=3,
1929
project_id=project_id, macs=available_macs)
1930
assigned_macs = [vif['address'] for vif in nw_info]
1931
self.assertEquals(1, len(assigned_macs))
1932
self.assertEquals(available_macs.pop(), assigned_macs[0])
1933
self.network.deallocate_for_instance(self.context,
1934
instance_id=inst['id'],
1935
host=self.network.host,
1936
project_id=project_id)
1938
def test_allocate_for_instance_not_enough_macs(self):
1939
available_macs = set()
1940
inst = db.instance_create(self.context, {'host': self.compute.host,
1941
'display_name': HOST,
1942
'instance_type_id': 1})
1943
networks = db.network_get_all(self.context)
1944
for network in networks:
1945
db.network_update(self.context, network['id'],
1946
{'host': self.network.host})
1947
project_id = self.context.project_id
1948
self.assertRaises(exception.VirtualInterfaceCreateException,
1949
self.network.allocate_for_instance, self.context,
1950
instance_id=inst['id'], instance_uuid=inst['uuid'],
1951
host=inst['host'], vpn=None, rxtx_factor=3,
1952
project_id=project_id, macs=available_macs)
1955
1626
class FloatingIPTestCase(test.TestCase):
1956
"""Tests nova.network.manager.FloatingIP."""
1627
"""Tests nova.network.manager.FloatingIP"""
1957
1628
def setUp(self):
1958
1629
super(FloatingIPTestCase, self).setUp()
1959
self.tempdir = self.useFixture(fixtures.TempDir()).path
1630
self.tempdir = tempfile.mkdtemp()
1960
1631
self.flags(log_dir=self.tempdir)
1961
1632
self.network = TestFloatingIPManager()
1962
1633
self.network.db = db