Resynced helpers
This commit is contained in:
		@@ -1,4 +1,4 @@
 | 
			
		||||
branch: lp:~openstack-charmers/charm-helpers/icehouse
 | 
			
		||||
branch: lp:charm-helpers
 | 
			
		||||
destination: hooks/charmhelpers
 | 
			
		||||
include:
 | 
			
		||||
    - core
 | 
			
		||||
 
 | 
			
		||||
@@ -199,6 +199,7 @@ class AMQPContext(OSContextGenerator):
 | 
			
		||||
 | 
			
		||||
        ctxt = {}
 | 
			
		||||
        for rid in relation_ids('amqp'):
 | 
			
		||||
            ha_vip_only = False
 | 
			
		||||
            for unit in related_units(rid):
 | 
			
		||||
                if relation_get('clustered', rid=rid, unit=unit):
 | 
			
		||||
                    ctxt['clustered'] = True
 | 
			
		||||
@@ -213,16 +214,18 @@ class AMQPContext(OSContextGenerator):
 | 
			
		||||
                                                      unit=unit),
 | 
			
		||||
                    'rabbitmq_virtual_host': vhost,
 | 
			
		||||
                })
 | 
			
		||||
                if relation_get('ha_queues', rid=rid, unit=unit) is not None:
 | 
			
		||||
                    ctxt['rabbitmq_ha_queues'] = True
 | 
			
		||||
 | 
			
		||||
                ha_vip_only = relation_get('ha-vip-only',
 | 
			
		||||
                                           rid=rid, unit=unit) is not None
 | 
			
		||||
 | 
			
		||||
                if context_complete(ctxt):
 | 
			
		||||
                    # Sufficient information found = break out!
 | 
			
		||||
                    break
 | 
			
		||||
            # Used for active/active rabbitmq >= grizzly
 | 
			
		||||
            if ('clustered' not in ctxt or relation_get('ha-vip-only') == 'True') and \
 | 
			
		||||
               len(related_units(rid)) > 1:
 | 
			
		||||
                if relation_get('ha_queues'):
 | 
			
		||||
                    ctxt['rabbitmq_ha_queues'] = relation_get('ha_queues')
 | 
			
		||||
                else:
 | 
			
		||||
                    ctxt['rabbitmq_ha_queues'] = False
 | 
			
		||||
            if ('clustered' not in ctxt or ha_vip_only) \
 | 
			
		||||
                    and len(related_units(rid)) > 1:
 | 
			
		||||
                rabbitmq_hosts = []
 | 
			
		||||
                for unit in related_units(rid):
 | 
			
		||||
                    rabbitmq_hosts.append(relation_get('private-address',
 | 
			
		||||
 
 | 
			
		||||
@@ -3,8 +3,8 @@
 | 
			
		||||
# cinder configuration file maintained by Juju
 | 
			
		||||
# local changes may be overwritten.
 | 
			
		||||
###############################################################################
 | 
			
		||||
{% if auth -%}
 | 
			
		||||
[global]
 | 
			
		||||
{% if auth -%}
 | 
			
		||||
 auth_supported = {{ auth }}
 | 
			
		||||
 keyring = /etc/ceph/$cluster.$name.keyring
 | 
			
		||||
 mon host = {{ mon_hosts }}
 | 
			
		||||
@@ -12,3 +12,4 @@
 | 
			
		||||
 log to syslog = {{ use_syslog }}
 | 
			
		||||
 err to syslog = {{ use_syslog }}
 | 
			
		||||
 clog to syslog = {{ use_syslog }}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -423,9 +423,7 @@ def get_hostname(address, fqdn=True):
 | 
			
		||||
    Resolves hostname for given IP, or returns the input
 | 
			
		||||
    if it is already a hostname.
 | 
			
		||||
    """
 | 
			
		||||
    if not is_ip(address):
 | 
			
		||||
        return address
 | 
			
		||||
 | 
			
		||||
    if is_ip(address):
 | 
			
		||||
        try:
 | 
			
		||||
            import dns.reversename
 | 
			
		||||
        except ImportError:
 | 
			
		||||
@@ -436,6 +434,8 @@ def get_hostname(address, fqdn=True):
 | 
			
		||||
        result = ns_query(rev)
 | 
			
		||||
        if not result:
 | 
			
		||||
            return None
 | 
			
		||||
    else:
 | 
			
		||||
        result = address
 | 
			
		||||
 | 
			
		||||
    if fqdn:
 | 
			
		||||
        # strip trailing .
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user