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 |
Ann Taraday | 8204f72 | 2018-12-12 16:38:57 +0400 | [diff] [blame] | 15 | from neutronv2 import ports |
Oleh Hryhorov | 4ce5d2c | 2018-11-08 18:41:20 +0200 | [diff] [blame] | 16 | from neutronv2 import common |
Vyacheslav Struk | 3f529d4 | 2019-06-13 13:37:25 +0300 | [diff] [blame^] | 17 | from neutronv2 import rbac |
Oleksiy Petrenko | 5bfb8bc | 2018-08-23 15:08:17 +0300 | [diff] [blame] | 18 | |
Oleksiy Petrenko | caad203 | 2018-04-20 14:42:46 +0300 | [diff] [blame] | 19 | |
| 20 | network_get_details = networks.network_get_details |
| 21 | network_update = networks.network_update |
| 22 | network_delete = networks.network_delete |
Oleksiy Petrenko | 5bfb8bc | 2018-08-23 15:08:17 +0300 | [diff] [blame] | 23 | network_list = lists.network_list |
Oleksiy Petrenko | caad203 | 2018-04-20 14:42:46 +0300 | [diff] [blame] | 24 | network_create = networks.network_create |
| 25 | network_bulk_create = networks.network_bulk_create |
| 26 | |
| 27 | subnetpool_get_details = subnetpools.subnetpool_get_details |
| 28 | subnetpool_update = subnetpools.subnetpool_update |
| 29 | subnetpool_delete = subnetpools.subnetpool_delete |
Oleksiy Petrenko | 5bfb8bc | 2018-08-23 15:08:17 +0300 | [diff] [blame] | 30 | subnetpool_list = lists.subnetpool_list |
Oleksiy Petrenko | caad203 | 2018-04-20 14:42:46 +0300 | [diff] [blame] | 31 | subnetpool_create = subnetpools.subnetpool_create |
| 32 | |
| 33 | auto_alloc_get_details = auto_alloc.auto_alloc_get_details |
| 34 | auto_alloc_delete = auto_alloc.auto_alloc_delete |
| 35 | |
Oleksiy Petrenko | 5bfb8bc | 2018-08-23 15:08:17 +0300 | [diff] [blame] | 36 | subnet_list = lists.subnet_list |
Oleksiy Petrenko | caad203 | 2018-04-20 14:42:46 +0300 | [diff] [blame] | 37 | subnet_create = subnets.subnet_create |
| 38 | subnet_bulk_create = subnets.subnet_bulk_create |
| 39 | subnet_get_details = subnets.subnet_get_details |
| 40 | subnet_update = subnets.subnet_update |
| 41 | subnet_delete = subnets.subnet_delete |
| 42 | |
| 43 | |
Oleksiy Petrenko | 5bfb8bc | 2018-08-23 15:08:17 +0300 | [diff] [blame] | 44 | agent_list = lists.agent_list |
| 45 | agent_get_details = agents.agent_get_details |
| 46 | agent_update = agents.agent_update |
| 47 | agent_delete = agents.agent_delete |
| 48 | l3_agent_router_list = agents.l3_agent_router_list |
| 49 | l3_agent_router_schedule = agents.l3_agent_router_schedule |
| 50 | l3_agent_router_remove = agents.l3_agent_router_remove |
| 51 | l3_agent_by_router_list = agents.l3_agent_by_router_list |
| 52 | dhcp_agent_list_networks = agents.dhcp_agent_list_networks |
| 53 | dhcp_agent_network_schedule = agents.dhcp_agent_network_schedule |
| 54 | dhcp_agent_network_remove = agents.dhcp_agent_network_remove |
| 55 | dhcp_agent_by_network_list = agents.dhcp_agent_by_network_list |
| 56 | |
| 57 | |
| 58 | router_list = lists.router_list |
| 59 | router_create = routers.router_create |
| 60 | router_get_details = routers.router_get_details |
| 61 | router_update = routers.router_update |
| 62 | router_delete = routers.router_delete |
| 63 | router_interface_add = routers.router_interface_add |
| 64 | router_interface_remove = routers.router_interface_remove |
| 65 | |
Ann Taraday | 8204f72 | 2018-12-12 16:38:57 +0400 | [diff] [blame] | 66 | port_list = lists.port_list |
| 67 | port_create = ports.port_create |
| 68 | port_delete = ports.port_delete |
| 69 | port_update = ports.port_update |
| 70 | port_get_details = ports.port_get_details |
| 71 | |
| 72 | |
Vyacheslav Struk | 3f529d4 | 2019-06-13 13:37:25 +0300 | [diff] [blame^] | 73 | rbac_policies_list = lists.rbac_policies_list |
| 74 | rbac_policies_create = rbac.rbac_policies_create |
| 75 | rbac_policies_delete = rbac.rbac_policies_delete |
| 76 | |
Vasyl Saienko | ba42073 | 2018-09-07 10:19:32 +0000 | [diff] [blame] | 77 | wait_for_network_services = agents.wait_for_network_services |
Oleksiy Petrenko | 5bfb8bc | 2018-08-23 15:08:17 +0300 | [diff] [blame] | 78 | |
Oleh Hryhorov | 4ce5d2c | 2018-11-08 18:41:20 +0200 | [diff] [blame] | 79 | wait_for_api_ready = common.wait_for_api_ready |
| 80 | |
Oleksiy Petrenko | caad203 | 2018-04-20 14:42:46 +0300 | [diff] [blame] | 81 | __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 Petrenko | 5bfb8bc | 2018-08-23 15:08:17 +0300 | [diff] [blame] | 88 | '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 Taraday | 8204f72 | 2018-12-12 16:38:57 +0400 | [diff] [blame] | 95 | 'port_create', 'port_delete', 'port_update', 'port_list', 'port_get_details', |
Vyacheslav Struk | 3f529d4 | 2019-06-13 13:37:25 +0300 | [diff] [blame^] | 96 | 'rbac_policies_create' 'rbac_policies_delete', 'rbac_policies_list', |
Oleksiy Petrenko | caad203 | 2018-04-20 14:42:46 +0300 | [diff] [blame] | 97 | ) |
| 98 | |
| 99 | |
| 100 | def __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.") |