Debian Codegraph @

contrib/templates/example/example_template/__init__.py

raw symbols SCIP
1 # Copyright (c) 2015 Rackspace Inc.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12 # implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 import os
17
18 from magnum.drivers.common import template_def
19
20
21 class ExampleTemplate(template_def.BaseTemplateDefinition):
22 provides = [
23 {'server_type': 'vm', 'os': 'example', 'coe': 'example_coe'},
24 {'server_type': 'vm', 'os': 'example2', 'coe': 'example_coe'},
25 ]
26
27 def __init__(self):
28 super(ExampleTemplate, self).__init__()
29
30 self.add_output('server_address',
31 cluster_attr='api_address')
32 self.add_output('node_addresses',
33 cluster_attr='node_addresses')
34
35 def template_path(self):
36 return os.path.join(os.path.dirname(__file__), 'example.yaml')