Oleksiy Petrenko | caad203 | 2018-04-20 14:42:46 +0300 | [diff] [blame] | 1 | try: |
| 2 | import os_client_config |
| 3 | from keystoneauth1 import exceptions as ka_exceptions |
| 4 | REQUIREMENTS_MET = True |
| 5 | except ImportError: |
| 6 | REQUIREMENTS_MET = False |
| 7 | |
Oleksiy Petrenko | 5bfb8bc | 2018-08-23 15:08:17 +0300 | [diff] [blame] | 8 | from neutronv2 import lists |
Oleksiy Petrenko | caad203 | 2018-04-20 14:42:46 +0300 | [diff] [blame] | 9 | from neutronv2 import networks |
| 10 | from neutronv2 import subnetpools |
| 11 | from neutronv2 import auto_alloc |
| 12 | from neutronv2 import subnets |
Oleksiy Petrenko | 5bfb8bc | 2018-08-23 15:08:17 +0300 | [diff] [blame] | 13 | from neutronv2 import agents |
| 14 | from neutronv2 import routers |
| 15 | |
Oleksiy Petrenko | caad203 | 2018-04-20 14:42:46 +0300 | [diff] [blame] | 16 | |
| 17 | network_get_details = networks.network_get_details |
| 18 | network_update = networks.network_update |
| 19 | network_delete = networks.network_delete |
Oleksiy Petrenko | 5bfb8bc | 2018-08-23 15:08:17 +0300 | [diff] [blame] | 20 | network_list = lists.network_list |
Oleksiy Petrenko | caad203 | 2018-04-20 14:42:46 +0300 | [diff] [blame] | 21 | network_create = networks.network_create |
| 22 | network_bulk_create = networks.network_bulk_create |
| 23 | |
| 24 | subnetpool_get_details = subnetpools.subnetpool_get_details |
| 25 | subnetpool_update = subnetpools.subnetpool_update |
| 26 | subnetpool_delete = subnetpools.subnetpool_delete |
Oleksiy Petrenko | 5bfb8bc | 2018-08-23 15:08:17 +0300 | [diff] [blame] | 27 | subnetpool_list = lists.subnetpool_list |
Oleksiy Petrenko | caad203 | 2018-04-20 14:42:46 +0300 | [diff] [blame] | 28 | subnetpool_create = subnetpools.subnetpool_create |
| 29 | |
| 30 | auto_alloc_get_details = auto_alloc.auto_alloc_get_details |
| 31 | auto_alloc_delete = auto_alloc.auto_alloc_delete |
| 32 | |
Oleksiy Petrenko | 5bfb8bc | 2018-08-23 15:08:17 +0300 | [diff] [blame] | 33 | subnet_list = lists.subnet_list |
Oleksiy Petrenko | caad203 | 2018-04-20 14:42:46 +0300 | [diff] [blame] | 34 | subnet_create = subnets.subnet_create |
| 35 | subnet_bulk_create = subnets.subnet_bulk_create |
| 36 | subnet_get_details = subnets.subnet_get_details |
| 37 | subnet_update = subnets.subnet_update |
| 38 | subnet_delete = subnets.subnet_delete |
| 39 | |
| 40 | |
Oleksiy Petrenko | 5bfb8bc | 2018-08-23 15:08:17 +0300 | [diff] [blame] | 41 | agent_list = lists.agent_list |
| 42 | agent_get_details = agents.agent_get_details |
| 43 | agent_update = agents.agent_update |
| 44 | agent_delete = agents.agent_delete |
| 45 | l3_agent_router_list = agents.l3_agent_router_list |
| 46 | l3_agent_router_schedule = agents.l3_agent_router_schedule |
| 47 | l3_agent_router_remove = agents.l3_agent_router_remove |
| 48 | l3_agent_by_router_list = agents.l3_agent_by_router_list |
| 49 | dhcp_agent_list_networks = agents.dhcp_agent_list_networks |
| 50 | dhcp_agent_network_schedule = agents.dhcp_agent_network_schedule |
| 51 | dhcp_agent_network_remove = agents.dhcp_agent_network_remove |
| 52 | dhcp_agent_by_network_list = agents.dhcp_agent_by_network_list |
| 53 | |
| 54 | |
| 55 | router_list = lists.router_list |
| 56 | router_create = routers.router_create |
| 57 | router_get_details = routers.router_get_details |
| 58 | router_update = routers.router_update |
| 59 | router_delete = routers.router_delete |
| 60 | router_interface_add = routers.router_interface_add |
| 61 | router_interface_remove = routers.router_interface_remove |
| 62 | |
Vasyl Saienko | ba42073 | 2018-09-07 10:19:32 +0000 | [diff] [blame^] | 63 | wait_for_network_services = agents.wait_for_network_services |
Oleksiy Petrenko | 5bfb8bc | 2018-08-23 15:08:17 +0300 | [diff] [blame] | 64 | |
Oleksiy Petrenko | caad203 | 2018-04-20 14:42:46 +0300 | [diff] [blame] | 65 | __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 Petrenko | 5bfb8bc | 2018-08-23 15:08:17 +0300 | [diff] [blame] | 72 | '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 Petrenko | caad203 | 2018-04-20 14:42:46 +0300 | [diff] [blame] | 79 | ) |
| 80 | |
| 81 | |
| 82 | def __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.") |