~openstack-charmers-next/charms/wily/nova-cloud-controller/trunk

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/contrib/openstack/ip.py

  • Committer: James Page
  • Date: 2016-06-17 10:52:35 UTC
  • Revision ID: james.page@ubuntu.com-20160617105235-vs2clgt11766yyjv
Switch to using charm-store for amulet tests

All OpenStack charms are now directly published to the charm store
on landing; switch Amulet helper to resolve charms using the
charm store rather than bzr branches, removing the lag between
charm changes landing and being available for other charms to
use for testing.

This is also important for new layered charms where the charm must
be build and published prior to being consumable.

Change-Id: Ia4cbe14575851c0f54cbb5845ffd6b8669fb7fa2

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
        return addr_override.format(service_name=service_name())
110
110
 
111
111
 
112
 
def resolve_address(endpoint_type=PUBLIC):
 
112
def resolve_address(endpoint_type=PUBLIC, override=True):
113
113
    """Return unit address depending on net config.
114
114
 
115
115
    If unit is clustered with vip(s) and has net splits defined, return vip on
119
119
    split if one is configured, or a Juju 2.0 extra-binding has been used.
120
120
 
121
121
    :param endpoint_type: Network endpoing type
 
122
    :param override: Accept hostname overrides or not
122
123
    """
123
 
    resolved_address = _get_address_override(endpoint_type)
124
 
    if resolved_address:
125
 
        return resolved_address
 
124
    resolved_address = None
 
125
    if override:
 
126
        resolved_address = _get_address_override(endpoint_type)
 
127
        if resolved_address:
 
128
            return resolved_address
126
129
 
127
130
    vips = config('vip')
128
131
    if vips: