blob: 85db2b708b11e2eb75faa63d6bc896140c50998a [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
15
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030016
17network_get_details = networks.network_get_details
18network_update = networks.network_update
19network_delete = networks.network_delete
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030020network_list = lists.network_list
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030021network_create = networks.network_create
22network_bulk_create = networks.network_bulk_create
23
24subnetpool_get_details = subnetpools.subnetpool_get_details
25subnetpool_update = subnetpools.subnetpool_update
26subnetpool_delete = subnetpools.subnetpool_delete
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030027subnetpool_list = lists.subnetpool_list
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030028subnetpool_create = subnetpools.subnetpool_create
29
30auto_alloc_get_details = auto_alloc.auto_alloc_get_details
31auto_alloc_delete = auto_alloc.auto_alloc_delete
32
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030033subnet_list = lists.subnet_list
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030034subnet_create = subnets.subnet_create
35subnet_bulk_create = subnets.subnet_bulk_create
36subnet_get_details = subnets.subnet_get_details
37subnet_update = subnets.subnet_update
38subnet_delete = subnets.subnet_delete
39
40
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030041agent_list = lists.agent_list
42agent_get_details = agents.agent_get_details
43agent_update = agents.agent_update
44agent_delete = agents.agent_delete
45l3_agent_router_list = agents.l3_agent_router_list
46l3_agent_router_schedule = agents.l3_agent_router_schedule
47l3_agent_router_remove = agents.l3_agent_router_remove
48l3_agent_by_router_list = agents.l3_agent_by_router_list
49dhcp_agent_list_networks = agents.dhcp_agent_list_networks
50dhcp_agent_network_schedule = agents.dhcp_agent_network_schedule
51dhcp_agent_network_remove = agents.dhcp_agent_network_remove
52dhcp_agent_by_network_list = agents.dhcp_agent_by_network_list
53
54
55router_list = lists.router_list
56router_create = routers.router_create
57router_get_details = routers.router_get_details
58router_update = routers.router_update
59router_delete = routers.router_delete
60router_interface_add = routers.router_interface_add
61router_interface_remove = routers.router_interface_remove
62
Vasyl Saienkoba420732018-09-07 10:19:32 +000063wait_for_network_services = agents.wait_for_network_services
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030064
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030065__all__ = (
66 'network_get_details', 'network_update', 'network_delete', 'network_list',
67 'network_create', 'network_bulk_create', 'subnetpool_get_details',
68 'subnetpool_update', 'subnetpool_delete', 'subnetpool_list',
69 'subnetpool_create', 'auto_alloc_get_details', 'auto_alloc_delete',
70 'subnet_list', 'subnet_create', 'subnet_bulk_create', 'subnet_get_details',
71 'subnet_update', 'subnet_delete',
Oleksiy Petrenko5bfb8bc2018-08-23 15:08:17 +030072 'agent_list', 'agent_delete', 'agent_get_details', 'agent_update',
73 'l3_agent_by_router_list', 'l3_agent_router_list',
74 'l3_agent_router_remove', 'l3_agent_router_schedule',
75 'dhcp_agent_by_network_list', 'dhcp_agent_list_networks',
76 'dhcp_agent_network_remove', 'dhcp_agent_network_schedule',
77 'router_list', 'router_create', 'router_delete', 'router_get_details',
78 'router_interface_add', 'router_interface_remove', 'router_update',
Oleksiy Petrenkocaad2032018-04-20 14:42:46 +030079)
80
81
82def __virtual__():
83 """Only load neutronv2 if requirements are available."""
84 if REQUIREMENTS_MET:
85 return 'neutronv2'
86 else:
87 return False, ("The neutronv2 execution module cannot be loaded: "
88 "os_client_config or keystoneauth are unavailable.")