blob: d8b7f90ac72a260413a0b73c41ead0e8d2d298e4 [file] [log] [blame]
Oleksiy Petrenkoe2c8da22018-03-30 18:27:58 +03001# Copyright 2018 Mirantis Inc
2# All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15
16try:
17 import os_client_config
18 from keystoneauth1 import exceptions as ka_exceptions
19 REQUIREMENTS_MET = True
20except ImportError:
21 REQUIREMENTS_MET = False
22
23from manilang import share_types
Oleksandr Shyshkoc08432f2018-11-23 17:15:51 +000024from manilang import services
Oleksiy Petrenkoe2c8da22018-03-30 18:27:58 +030025
26list_share_types = share_types.list_share_types
27create_share_type = share_types.create_share_type
28set_share_type_extra_specs = share_types.set_share_type_extra_specs
29unset_share_type_extra_specs = share_types.unset_share_type_extra_specs
30delete_share_type = share_types.delete_share_type
Oleksandr Shyshkoc08432f2018-11-23 17:15:51 +000031service_list = services.service_list
32service_update = services.service_update
33service_wait = services.wait_for_service
Oleksiy Petrenkoe2c8da22018-03-30 18:27:58 +030034
35__all__ = (
36 'list_share_types', 'create_share_type',
37 'set_share_type_extra_specs', 'unset_share_type_extra_specs',
Oleksandr Shyshkoc08432f2018-11-23 17:15:51 +000038 'delete_share_type','service_list', 'service_update', 'service_wait',
Oleksiy Petrenkoe2c8da22018-03-30 18:27:58 +030039)
40
41
42def __virtual__():
43 """Only load manilang if requirements are available."""
44 if REQUIREMENTS_MET:
45 return 'manilang'
46 else:
47 return False, ("The manilang execution module cannot be loaded: "
48 "os_client_config or keystoneauth are unavailable.")