blob: e275af60c80450d27ed71ec699259ac43f66a72a [file] [log] [blame]
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +03001try:
2 import os_client_config
3 from keystoneauth1 import exceptions as ka_exceptions
4 REQUIREMENTS_MET = True
5except ImportError:
6 REQUIREMENTS_MET = False
7
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +03008from neutronv2 import lists
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +03009from neutronv2 import networks
10from neutronv2 import subnetpools
11from neutronv2 import auto_alloc
12from neutronv2 import subnets
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030013from neutronv2 import agents
14from neutronv2 import routers
Oleh Hryhorov4ce5d2c2018-11-08 18:41:20 +020015from neutronv2 import common
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030016
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030017
18network_get_details = networks.network_get_details
19network_update = networks.network_update
20network_delete = networks.network_delete
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030021network_list = lists.network_list
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030022network_create = networks.network_create
23network_bulk_create = networks.network_bulk_create
24
25subnetpool_get_details = subnetpools.subnetpool_get_details
26subnetpool_update = subnetpools.subnetpool_update
27subnetpool_delete = subnetpools.subnetpool_delete
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030028subnetpool_list = lists.subnetpool_list
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030029subnetpool_create = subnetpools.subnetpool_create
30
31auto_alloc_get_details = auto_alloc.auto_alloc_get_details
32auto_alloc_delete = auto_alloc.auto_alloc_delete
33
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030034subnet_list = lists.subnet_list
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030035subnet_create = subnets.subnet_create
36subnet_bulk_create = subnets.subnet_bulk_create
37subnet_get_details = subnets.subnet_get_details
38subnet_update = subnets.subnet_update
39subnet_delete = subnets.subnet_delete
40
41
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030042agent_list = lists.agent_list
43agent_get_details = agents.agent_get_details
44agent_update = agents.agent_update
45agent_delete = agents.agent_delete
46l3_agent_router_list = agents.l3_agent_router_list
47l3_agent_router_schedule = agents.l3_agent_router_schedule
48l3_agent_router_remove = agents.l3_agent_router_remove
49l3_agent_by_router_list = agents.l3_agent_by_router_list
50dhcp_agent_list_networks = agents.dhcp_agent_list_networks
51dhcp_agent_network_schedule = agents.dhcp_agent_network_schedule
52dhcp_agent_network_remove = agents.dhcp_agent_network_remove
53dhcp_agent_by_network_list = agents.dhcp_agent_by_network_list
54
55
56router_list = lists.router_list
57router_create = routers.router_create
58router_get_details = routers.router_get_details
59router_update = routers.router_update
60router_delete = routers.router_delete
61router_interface_add = routers.router_interface_add
62router_interface_remove = routers.router_interface_remove
63
Vasyl Saienkoba420732018-09-07 10:19:32 +000064wait_for_network_services = agents.wait_for_network_services
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030065
Oleh Hryhorov4ce5d2c2018-11-08 18:41:20 +020066wait_for_api_ready = common.wait_for_api_ready
67
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030068__all__ = (
69 'network_get_details', 'network_update', 'network_delete', 'network_list',
70 'network_create', 'network_bulk_create', 'subnetpool_get_details',
71 'subnetpool_update', 'subnetpool_delete', 'subnetpool_list',
72 'subnetpool_create', 'auto_alloc_get_details', 'auto_alloc_delete',
73 'subnet_list', 'subnet_create', 'subnet_bulk_create', 'subnet_get_details',
74 'subnet_update', 'subnet_delete',
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030075 'agent_list', 'agent_delete', 'agent_get_details', 'agent_update',
76 'l3_agent_by_router_list', 'l3_agent_router_list',
77 'l3_agent_router_remove', 'l3_agent_router_schedule',
78 'dhcp_agent_by_network_list', 'dhcp_agent_list_networks',
79 'dhcp_agent_network_remove', 'dhcp_agent_network_schedule',
80 'router_list', 'router_create', 'router_delete', 'router_get_details',
81 'router_interface_add', 'router_interface_remove', 'router_update',
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030082)
83
84
85def __virtual__():
86 """Only load neutronv2 if requirements are available."""
87 if REQUIREMENTS_MET:
88 return 'neutronv2'
89 else:
90 return False, ("The neutronv2 execution module cannot be loaded: "
91 "os_client_config or keystoneauth are unavailable.")