blob: c6ebe0f0e38aa8f2e7331538e2608f2956bafd1d [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
Vyacheslav Struk3f529d42019-06-13 13:37:25 +030017from neutronv2 import rbac
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030018
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030019
20network_get_details = networks.network_get_details
21network_update = networks.network_update
22network_delete = networks.network_delete
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030023network_list = lists.network_list
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030024network_create = networks.network_create
25network_bulk_create = networks.network_bulk_create
26
27subnetpool_get_details = subnetpools.subnetpool_get_details
28subnetpool_update = subnetpools.subnetpool_update
29subnetpool_delete = subnetpools.subnetpool_delete
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030030subnetpool_list = lists.subnetpool_list
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030031subnetpool_create = subnetpools.subnetpool_create
32
33auto_alloc_get_details = auto_alloc.auto_alloc_get_details
34auto_alloc_delete = auto_alloc.auto_alloc_delete
35
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030036subnet_list = lists.subnet_list
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030037subnet_create = subnets.subnet_create
38subnet_bulk_create = subnets.subnet_bulk_create
39subnet_get_details = subnets.subnet_get_details
40subnet_update = subnets.subnet_update
41subnet_delete = subnets.subnet_delete
42
43
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030044agent_list = lists.agent_list
45agent_get_details = agents.agent_get_details
46agent_update = agents.agent_update
47agent_delete = agents.agent_delete
48l3_agent_router_list = agents.l3_agent_router_list
49l3_agent_router_schedule = agents.l3_agent_router_schedule
50l3_agent_router_remove = agents.l3_agent_router_remove
51l3_agent_by_router_list = agents.l3_agent_by_router_list
52dhcp_agent_list_networks = agents.dhcp_agent_list_networks
53dhcp_agent_network_schedule = agents.dhcp_agent_network_schedule
54dhcp_agent_network_remove = agents.dhcp_agent_network_remove
55dhcp_agent_by_network_list = agents.dhcp_agent_by_network_list
56
57
58router_list = lists.router_list
59router_create = routers.router_create
60router_get_details = routers.router_get_details
61router_update = routers.router_update
62router_delete = routers.router_delete
63router_interface_add = routers.router_interface_add
64router_interface_remove = routers.router_interface_remove
65
Ann Taraday8204f722018-12-12 16:38:57 +040066port_list = lists.port_list
67port_create = ports.port_create
68port_delete = ports.port_delete
69port_update = ports.port_update
70port_get_details = ports.port_get_details
71
72
Vyacheslav Struk3f529d42019-06-13 13:37:25 +030073rbac_policies_list = lists.rbac_policies_list
74rbac_policies_create = rbac.rbac_policies_create
75rbac_policies_delete = rbac.rbac_policies_delete
76
Vasyl Saienkoba420732018-09-07 10:19:32 +000077wait_for_network_services = agents.wait_for_network_services
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030078
Oleh Hryhorov4ce5d2c2018-11-08 18:41:20 +020079wait_for_api_ready = common.wait_for_api_ready
80
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030081__all__ = (
82 'network_get_details', 'network_update', 'network_delete', 'network_list',
83 'network_create', 'network_bulk_create', 'subnetpool_get_details',
84 'subnetpool_update', 'subnetpool_delete', 'subnetpool_list',
85 'subnetpool_create', 'auto_alloc_get_details', 'auto_alloc_delete',
86 'subnet_list', 'subnet_create', 'subnet_bulk_create', 'subnet_get_details',
87 'subnet_update', 'subnet_delete',
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030088 'agent_list', 'agent_delete', 'agent_get_details', 'agent_update',
89 'l3_agent_by_router_list', 'l3_agent_router_list',
90 'l3_agent_router_remove', 'l3_agent_router_schedule',
91 'dhcp_agent_by_network_list', 'dhcp_agent_list_networks',
92 'dhcp_agent_network_remove', 'dhcp_agent_network_schedule',
93 'router_list', 'router_create', 'router_delete', 'router_get_details',
94 'router_interface_add', 'router_interface_remove', 'router_update',
Ann Taraday8204f722018-12-12 16:38:57 +040095 'port_create', 'port_delete', 'port_update', 'port_list', 'port_get_details',
Vyacheslav Struk3f529d42019-06-13 13:37:25 +030096 'rbac_policies_create' 'rbac_policies_delete', 'rbac_policies_list',
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030097)
98
99
100def __virtual__():
101 """Only load neutronv2 if requirements are available."""
102 if REQUIREMENTS_MET:
103 return 'neutronv2'
104 else:
105 return False, ("The neutronv2 execution module cannot be loaded: "
106 "os_client_config or keystoneauth are unavailable.")