Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Add private space binding #1

Open
wants to merge 2 commits into
base: add-private-space-binding
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,11 @@ The 'openstack-origin' setting allows Swift to be installed from installation
repositories and can be used to setup access to the Ubuntu Cloud Archive
to support installing Swift versions more recent than what is shipped with
Ubuntu 12.04 (1.4.8). For more information, see config.yaml.

**Juju Spaces Awareness**

The juju space binding for "private" has been added to the charm to allow
for override of the unit's default private-address advertised to it's proxy
relations. This is done in case swift-storage units are landed on machines
that have alternative networks defined that are not accessible from the
swift-proxy units it is to be related with.
7 changes: 7 additions & 0 deletions hooks/swift_storage_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
relation_set,
relations_of_type,
status_set,
network_get_primary_address,
)

from charmhelpers.fetch import (
Expand Down Expand Up @@ -156,6 +157,12 @@ def swift_storage_relation_joined(rid=None):
# Keep a reference of devices we are adding to the ring
remember_devices(devs)

# Fix for lp:1697491 - Assign "private" binding to network you
# wish to relate with swift-proxy on. Fails back to unit def.
private_binding_address = network_get_primary_address('private')
if private_binding_address is not None:
rel_settings['private-address'] = private_binding_address

if config('prefer-ipv6'):
rel_settings['private-address'] = get_ipv6_addr()[0]

Expand Down
2 changes: 2 additions & 0 deletions metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ series:
- zesty
- trusty
- yakkety
extra-bindings:
private:
provides:
nrpe-external-master:
interface: nrpe-external-master
Expand Down