~openstack-charmers-next/charms/wily/ceilometer-agent/trunk

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/contrib/hahelpers/cluster.py

  • Committer: James Page
  • Date: 2016-07-06 15:28:23 UTC
  • Revision ID: james.page@ubuntu.com-20160706152823-scb63imo4kn6q6ms
Resync charmhelpers for licensing change

The charm-helpers project have re-licensed to Apache 2.0
inline with the agreed licensing approach to intefaces,
layers and charms generally.

Resync helpers to bring charmhelpers inline with charm
codebase.

Change-Id: I65dc4dd6161aab73819f49c26331d0a5dfe5deab

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright 2014-2015 Canonical Limited.
2
2
#
3
 
# This file is part of charm-helpers.
4
 
#
5
 
# charm-helpers is free software: you can redistribute it and/or modify
6
 
# it under the terms of the GNU Lesser General Public License version 3 as
7
 
# published by the Free Software Foundation.
8
 
#
9
 
# charm-helpers is distributed in the hope that it will be useful,
10
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 
# GNU Lesser General Public License for more details.
13
 
#
14
 
# You should have received a copy of the GNU Lesser General Public License
15
 
# along with charm-helpers.  If not, see <http://www.gnu.org/licenses/>.
 
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 implied.
 
12
# See the License for the specific language governing permissions and
 
13
# limitations under the License.
16
14
 
17
15
#
18
16
# Copyright 2012 Canonical Ltd.
280
278
    for initiating a relation to hacluster:
281
279
 
282
280
        ha-bindiface, ha-mcastport, vip, os-internal-hostname,
283
 
        os-admin-hostname, os-public-hostname
 
281
        os-admin-hostname, os-public-hostname, os-access-hostname
284
282
 
285
283
    param: exclude_keys: list of setting key(s) to be excluded.
286
284
    returns: dict: A dict containing settings keyed by setting name.
287
285
    raises: HAIncompleteConfig if settings are missing or incorrect.
288
286
    '''
289
287
    settings = ['ha-bindiface', 'ha-mcastport', 'vip', 'os-internal-hostname',
290
 
                'os-admin-hostname', 'os-public-hostname']
 
288
                'os-admin-hostname', 'os-public-hostname', 'os-access-hostname']
291
289
    conf = {}
292
290
    for setting in settings:
293
291
        if exclude_keys and setting in exclude_keys:
324
322
    # If dns-ha then one of os-*-hostname must be set
325
323
    if dns:
326
324
        dns_settings = ['os-internal-hostname', 'os-admin-hostname',
327
 
                        'os-public-hostname']
 
325
                        'os-public-hostname', 'os-access-hostname']
328
326
        # At this point it is unknown if one or all of the possible
329
327
        # network spaces are in HA. Validate at least one is set which is
330
328
        # the minimum required.