Vladyslav Drok | cb8d0fb | 2018-06-27 19:28:14 +0300 | [diff] [blame^] | 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 2 | # not use this file except in compliance with the License. You may obtain |
| 3 | # a copy of the License at |
| 4 | # |
| 5 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | # |
| 7 | # Unless required by applicable law or agreed to in writing, software |
| 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 10 | # License for the specific language governing permissions and limitations |
| 11 | # under the License. |
| 12 | |
| 13 | try: |
| 14 | import os_client_config |
| 15 | REQUIREMENTS_MET = True |
| 16 | except ImportError: |
| 17 | REQUIREMENTS_MET = False |
| 18 | |
| 19 | __virtualname__ = 'novav21' |
| 20 | |
| 21 | import aggregates |
| 22 | import flavors |
| 23 | import keypairs |
| 24 | import quotas |
| 25 | import servers |
| 26 | |
| 27 | aggregate_add_host = aggregates.add_host |
| 28 | aggregate_create = aggregates.create |
| 29 | aggregate_delete = aggregates.delete |
| 30 | aggregate_get = aggregates.get |
| 31 | aggregate_list = aggregates.list_ |
| 32 | aggregate_remove_host = aggregates.remove_host |
| 33 | aggregate_set_metadata = aggregates.set_metadata |
| 34 | flavor_add_extra_specs = flavors.add_extra_specs |
| 35 | flavor_create = flavors.create |
| 36 | flavor_delete = flavors.delete |
| 37 | flavor_delete_extra_spec = flavors.delete_extra_spec |
| 38 | flavor_get = flavors.get |
| 39 | flavor_get_extra_specs = flavors.get_extra_specs |
| 40 | flavor_list = flavors.list_ |
| 41 | keypair_create = keypairs.create |
| 42 | keypair_delete = keypairs.delete |
| 43 | keypair_get = keypairs.get |
| 44 | keypair_list = keypairs.list_ |
| 45 | quota_delete = quotas.delete |
| 46 | quota_list = quotas.list_ |
| 47 | quota_update = quotas.update |
| 48 | server_create = servers.create |
| 49 | server_delete = servers.delete |
| 50 | server_get = servers.get |
| 51 | server_list = servers.list_ |
| 52 | server_lock = servers.lock |
| 53 | server_resume = servers.resume |
| 54 | server_suspend = servers.suspend |
| 55 | server_unlock = servers.unlock |
| 56 | |
| 57 | |
| 58 | __all__ = ( |
| 59 | 'aggregate_add_host', 'aggregate_create', 'aggregate_delete', |
| 60 | 'aggregate_get', 'aggregate_list', 'aggregate_remove_host', |
| 61 | 'aggregate_set_metadata', 'flavor_add_extra_specs', 'flavor_create', |
| 62 | 'flavor_delete', 'flavor_delete_extra_spec', 'flavor_get', |
| 63 | 'flavor_get_extra_specs', 'flavor_list', 'keypair_create', |
| 64 | 'keypair_delete', 'keypair_get', 'keypair_list', 'quota_delete', |
| 65 | 'quota_list', 'quota_update', 'server_create', 'server_delete', |
| 66 | 'server_get', 'server_list', 'server_lock', 'server_resume', |
| 67 | 'server_suspend', 'server_unlock') |
| 68 | |
| 69 | |
| 70 | def __virtual__(): |
| 71 | if REQUIREMENTS_MET: |
| 72 | return __virtualname__ |
| 73 | else: |
| 74 | return False, ("The novav21 execution module cannot be loaded: " |
| 75 | "os_client_config package not found.") |