Vasyl Saienko | 4eda4f2 | 2018-04-26 19:30:39 +0300 | [diff] [blame] | 1 | try: |
| 2 | import os_client_config # noqa |
| 3 | from keystoneauth1 import exceptions as ka_exceptions # noqa |
| 4 | REQUIREMENTS_MET = True |
| 5 | except ImportError: |
| 6 | REQUIREMENTS_MET = False |
| 7 | |
Oleksiy Petrenko | e03e2c7 | 2018-08-10 13:24:32 +0300 | [diff] [blame] | 8 | from keystonev3 import lists |
Vasyl Saienko | 4eda4f2 | 2018-04-26 19:30:39 +0300 | [diff] [blame] | 9 | from keystonev3 import endpoints |
| 10 | from keystonev3 import roles |
| 11 | from keystonev3 import services |
| 12 | from keystonev3 import projects |
| 13 | from keystonev3 import users |
Oleksiy Petrenko | e03e2c7 | 2018-08-10 13:24:32 +0300 | [diff] [blame] | 14 | from keystonev3 import domains |
| 15 | from keystonev3 import regions |
| 16 | from keystonev3 import groups |
| 17 | |
| 18 | |
| 19 | domain_list = lists.domain_list |
| 20 | domain_create = domains.domain_create |
| 21 | domain_update = domains.domain_update |
| 22 | domain_get_details = domains.domain_get_details |
| 23 | domain_delete = domains.domain_delete |
Vasyl Saienko | 4eda4f2 | 2018-04-26 19:30:39 +0300 | [diff] [blame] | 24 | |
| 25 | endpoint_get_details = endpoints.endpoint_get_details |
| 26 | endpoint_update = endpoints.endpoint_update |
| 27 | endpoint_delete = endpoints.endpoint_delete |
Oleksiy Petrenko | e03e2c7 | 2018-08-10 13:24:32 +0300 | [diff] [blame] | 28 | endpoint_list = lists.endpoint_list |
Vasyl Saienko | 4eda4f2 | 2018-04-26 19:30:39 +0300 | [diff] [blame] | 29 | endpoint_create = endpoints.endpoint_create |
| 30 | |
Oleksiy Petrenko | e03e2c7 | 2018-08-10 13:24:32 +0300 | [diff] [blame] | 31 | role_assignment_list = lists.role_assignment_list |
| 32 | role_assign_for_user_on_project = roles.role_assign_for_user_on_project |
| 33 | role_assign_for_user_on_domain = roles.role_assign_for_user_on_domain |
| 34 | role_unassign_for_user_on_project = roles.role_unassign_for_user_on_project |
| 35 | role_unassign_for_user_on_domain = roles.role_unassign_for_user_on_domain |
| 36 | role_assign_check_for_user_on_project = roles.\ |
| 37 | role_assign_check_for_user_on_project |
| 38 | role_assign_check_for_user_on_domain = roles.\ |
| 39 | role_assign_check_for_user_on_domain |
Vasyl Saienko | 4eda4f2 | 2018-04-26 19:30:39 +0300 | [diff] [blame] | 40 | role_get_details = roles.role_get_details |
| 41 | role_update = roles.role_update |
Oleksiy Petrenko | e03e2c7 | 2018-08-10 13:24:32 +0300 | [diff] [blame] | 42 | role_list = lists.role_list |
Vasyl Saienko | 4eda4f2 | 2018-04-26 19:30:39 +0300 | [diff] [blame] | 43 | role_create = roles.role_create |
Oleksiy Petrenko | e03e2c7 | 2018-08-10 13:24:32 +0300 | [diff] [blame] | 44 | role_delete = roles.role_delete |
| 45 | |
| 46 | role_inference_rule_list = lists.role_inference_rule_list |
| 47 | role_inference_rule_for_role_list = roles.role_inference_rule_for_role_list |
| 48 | role_inference_rule_create = roles.role_inference_rule_create |
| 49 | role_inference_rule_get = roles.role_inference_rule_get |
| 50 | role_inference_rule_confirm = roles.role_inference_rule_confirm |
| 51 | role_inference_rule_delete = roles.role_inference_rule_delete |
| 52 | |
Vasyl Saienko | 4eda4f2 | 2018-04-26 19:30:39 +0300 | [diff] [blame] | 53 | |
| 54 | service_get_details = services.service_get_details |
| 55 | service_update = services.service_update |
| 56 | service_delete = services.service_delete |
Oleksiy Petrenko | e03e2c7 | 2018-08-10 13:24:32 +0300 | [diff] [blame] | 57 | service_list = lists.service_list |
Vasyl Saienko | 4eda4f2 | 2018-04-26 19:30:39 +0300 | [diff] [blame] | 58 | service_create = services.service_create |
| 59 | |
| 60 | project_get_details = projects.project_get_details |
| 61 | project_update = projects.project_update |
| 62 | project_delete = projects.project_delete |
Oleksiy Petrenko | e03e2c7 | 2018-08-10 13:24:32 +0300 | [diff] [blame] | 63 | project_list = lists.project_list |
Vasyl Saienko | 4eda4f2 | 2018-04-26 19:30:39 +0300 | [diff] [blame] | 64 | project_create = projects.project_create |
| 65 | |
| 66 | user_get_details = users.user_get_details |
| 67 | user_update = users.user_update |
| 68 | user_delete = users.user_delete |
Oleksiy Petrenko | e03e2c7 | 2018-08-10 13:24:32 +0300 | [diff] [blame] | 69 | user_list = lists.user_list |
Vasyl Saienko | 4eda4f2 | 2018-04-26 19:30:39 +0300 | [diff] [blame] | 70 | user_create = users.user_create |
| 71 | |
| 72 | |
Oleksiy Petrenko | e03e2c7 | 2018-08-10 13:24:32 +0300 | [diff] [blame] | 73 | region_list = lists.region_list |
| 74 | region_create = regions.region_create |
| 75 | region_get_details = regions.region_get_details |
| 76 | region_update = regions.region_update |
| 77 | region_delete = regions.region_delete |
| 78 | |
| 79 | group_list = lists.group_list |
| 80 | group_create = groups.group_create |
| 81 | group_get_details = groups.group_get_details |
| 82 | group_update = groups.group_update |
| 83 | group_delete = groups.group_delete |
| 84 | group_user_list = groups.group_user_list |
| 85 | group_user_add = groups.group_user_add |
| 86 | group_user_check = groups.group_user_check |
| 87 | group_user_remove = groups.group_user_remove |
| 88 | |
| 89 | |
Vasyl Saienko | 4eda4f2 | 2018-04-26 19:30:39 +0300 | [diff] [blame] | 90 | __all__ = ( |
Oleksiy Petrenko | e03e2c7 | 2018-08-10 13:24:32 +0300 | [diff] [blame] | 91 | 'domain_list', |
| 92 | 'domain_create', |
| 93 | 'domain_get_details', |
| 94 | 'domain_update', |
| 95 | 'domain_delete', |
Vasyl Saienko | 4eda4f2 | 2018-04-26 19:30:39 +0300 | [diff] [blame] | 96 | 'endpoint_get_details', |
| 97 | 'endpoint_update', |
| 98 | 'endpoint_delete', |
| 99 | 'endpoint_list', |
| 100 | 'endpoint_create', |
| 101 | 'role_assignment_list', |
Oleksiy Petrenko | e03e2c7 | 2018-08-10 13:24:32 +0300 | [diff] [blame] | 102 | 'role_assign_for_user_on_project', |
| 103 | 'role_assign_for_user_on_domain', |
| 104 | 'role_assign_check_for_user_on_domain', |
| 105 | 'role_assign_check_for_user_on_project', |
| 106 | 'role_unassign_for_user_on_domain', |
| 107 | 'role_unassign_for_user_on_project', |
Vasyl Saienko | 4eda4f2 | 2018-04-26 19:30:39 +0300 | [diff] [blame] | 108 | 'role_get_details', |
| 109 | 'role_update', |
| 110 | 'role_delete', |
| 111 | 'role_list', |
| 112 | 'role_create', |
Oleksiy Petrenko | e03e2c7 | 2018-08-10 13:24:32 +0300 | [diff] [blame] | 113 | 'role_inference_rule_confirm', |
| 114 | 'role_inference_rule_create', |
| 115 | 'role_inference_rule_delete', |
| 116 | 'role_inference_rule_for_role_list', |
| 117 | 'role_inference_rule_get', |
| 118 | 'role_inference_rule_list', |
Vasyl Saienko | 4eda4f2 | 2018-04-26 19:30:39 +0300 | [diff] [blame] | 119 | 'service_get_details', |
| 120 | 'service_update', |
| 121 | 'service_delete', |
| 122 | 'service_list', |
| 123 | 'service_create', |
| 124 | 'project_get_details', |
| 125 | 'project_update', |
| 126 | 'project_delete', |
| 127 | 'project_list', |
| 128 | 'project_create', |
| 129 | 'user_get_details', |
| 130 | 'user_update', |
| 131 | 'user_delete', |
| 132 | 'user_list', |
Oleksiy Petrenko | e03e2c7 | 2018-08-10 13:24:32 +0300 | [diff] [blame] | 133 | 'user_create', |
| 134 | 'region_create', |
| 135 | 'region_delete', |
| 136 | 'region_get_details', |
| 137 | 'region_list', |
| 138 | 'region_update', |
| 139 | 'group_list', |
| 140 | 'group_create', |
| 141 | 'group_delete', |
| 142 | 'group_get_details', |
| 143 | 'group_update', |
| 144 | 'group_user_add', |
| 145 | 'group_user_check', |
| 146 | 'group_user_list', |
| 147 | 'group_user_remove', |
Vasyl Saienko | 4eda4f2 | 2018-04-26 19:30:39 +0300 | [diff] [blame] | 148 | ) |
| 149 | |
| 150 | |
| 151 | def __virtual__(): |
| 152 | """Only load keystonev3 if requirements are available.""" |
| 153 | if REQUIREMENTS_MET: |
| 154 | return 'keystonev3' |
| 155 | else: |
| 156 | return False, ("The keystonev3 execution module cannot be loaded: " |
| 157 | "os_client_config or keystoneauth are unavailable.") |