Update tosca lib to version 0.5
[parser.git] / tosca2heat / heat-translator / translator / osc / osc_plugin.py
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 from translator.osc import utils
14
15 DEFAULT_TRANSLATOR_API_VERSION = '1'
16 API_VERSION_OPTION = 'os_translator_api_version'
17 API_NAME = 'translator'
18 API_VERSIONS = {
19     '1': 'translator.v1.client.Client',
20 }
21
22
23 def make_client(instance):
24     # NOTE(stevemar): We don't need a client because
25     # heat-translator itself is a command line tool
26     pass
27
28
29 def build_option_parser(parser):
30     """Hook to add global options."""
31
32     parser.add_argument(
33         '--os-translator-api-version',
34         metavar='<translator-api-version>',
35         default=utils.env(
36             'OS_TRANSLATOR_API_VERSION',
37             default=DEFAULT_TRANSLATOR_API_VERSION),
38         help='Translator API version, default=' +
39              DEFAULT_TRANSLATOR_API_VERSION +
40              ' (Env: OS_TRANSLATOR_API_VERSION)')
41     return parser