blob: 74b6fb157153454f7d1cd4e59c515430c47c77e2 [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
Ann Taraday8204f722018-12-12 16:38:57 +040015from neutronv2 import ports
Oleh Hryhorov4ce5d2c2018-11-08 18:41:20 +020016from neutronv2 import common
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030017
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030018
19network_get_details = networks.network_get_details
20network_update = networks.network_update
21network_delete = networks.network_delete
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030022network_list = lists.network_list
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030023network_create = networks.network_create
24network_bulk_create = networks.network_bulk_create
25
26subnetpool_get_details = subnetpools.subnetpool_get_details
27subnetpool_update = subnetpools.subnetpool_update
28subnetpool_delete = subnetpools.subnetpool_delete
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030029subnetpool_list = lists.subnetpool_list
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030030subnetpool_create = subnetpools.subnetpool_create
31
32auto_alloc_get_details = auto_alloc.auto_alloc_get_details
33auto_alloc_delete = auto_alloc.auto_alloc_delete
34
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030035subnet_list = lists.subnet_list
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030036subnet_create = subnets.subnet_create
37subnet_bulk_create = subnets.subnet_bulk_create
38subnet_get_details = subnets.subnet_get_details
39subnet_update = subnets.subnet_update
40subnet_delete = subnets.subnet_delete
41
42
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030043agent_list = lists.agent_list
44agent_get_details = agents.agent_get_details
45agent_update = agents.agent_update
46agent_delete = agents.agent_delete
47l3_agent_router_list = agents.l3_agent_router_list
48l3_agent_router_schedule = agents.l3_agent_router_schedule
49l3_agent_router_remove = agents.l3_agent_router_remove
50l3_agent_by_router_list = agents.l3_agent_by_router_list
51dhcp_agent_list_networks = agents.dhcp_agent_list_networks
52dhcp_agent_network_schedule = agents.dhcp_agent_network_schedule
53dhcp_agent_network_remove = agents.dhcp_agent_network_remove
54dhcp_agent_by_network_list = agents.dhcp_agent_by_network_list
55
56
57router_list = lists.router_list
58router_create = routers.router_create
59router_get_details = routers.router_get_details
60router_update = routers.router_update
61router_delete = routers.router_delete
62router_interface_add = routers.router_interface_add
63router_interface_remove = routers.router_interface_remove
64
Ann Taraday8204f722018-12-12 16:38:57 +040065port_list = lists.port_list
66port_create = ports.port_create
67port_delete = ports.port_delete
68port_update = ports.port_update
69port_get_details = ports.port_get_details
70
71
Vasyl Saienkoba420732018-09-07 10:19:32 +000072wait_for_network_services = agents.wait_for_network_services
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030073
Oleh Hryhorov4ce5d2c2018-11-08 18:41:20 +020074wait_for_api_ready = common.wait_for_api_ready
75
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030076__all__ = (
77 'network_get_details', 'network_update', 'network_delete', 'network_list',
78 'network_create', 'network_bulk_create', 'subnetpool_get_details',
79 'subnetpool_update', 'subnetpool_delete', 'subnetpool_list',
80 'subnetpool_create', 'auto_alloc_get_details', 'auto_alloc_delete',
81 'subnet_list', 'subnet_create', 'subnet_bulk_create', 'subnet_get_details',
82 'subnet_update', 'subnet_delete',
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030083 'agent_list', 'agent_delete', 'agent_get_details', 'agent_update',
84 'l3_agent_by_router_list', 'l3_agent_router_list',
85 'l3_agent_router_remove', 'l3_agent_router_schedule',
86 'dhcp_agent_by_network_list', 'dhcp_agent_list_networks',
87 'dhcp_agent_network_remove', 'dhcp_agent_network_schedule',
88 'router_list', 'router_create', 'router_delete', 'router_get_details',
89 'router_interface_add', 'router_interface_remove', 'router_update',
Ann Taraday8204f722018-12-12 16:38:57 +040090 'port_create', 'port_delete', 'port_update', 'port_list', 'port_get_details',
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030091)
92
93
94def __virtual__():
95 """Only load neutronv2 if requirements are available."""
96 if REQUIREMENTS_MET:
97 return 'neutronv2'
98 else:
99 return False, ("The neutronv2 execution module cannot be loaded: "
100 "os_client_config or keystoneauth are unavailable.")