Merge lp:~james-page/charms/trusty/percona-cluster/1497527-stable into lp:~openstack-charmers-archive/charms/trusty/percona-cluster/trunk

Proposed by James Page
Status: Merged
Merged at revision: 64
Proposed branch: lp:~james-page/charms/trusty/percona-cluster/1497527-stable
Merge into: lp:~openstack-charmers-archive/charms/trusty/percona-cluster/trunk
Diff against target: 56 lines (+22/-3)
1 file modified
hooks/percona_hooks.py (+22/-3)
To merge this branch: bzr merge lp:~james-page/charms/trusty/percona-cluster/1497527-stable
Reviewer Review Type Date Requested Status
charmers Pending
Review via email: mp+271773@code.launchpad.net
To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #10402 percona-cluster for james-page mp271773
    LINT FAIL: lint-test failed
    LINT FAIL: charm-proof failed

LINT Results (max last 2 lines):
make: *** [lint] Error 100
ERROR:root:Make target returned non-zero.

Full lint test output: http://paste.ubuntu.com/12513035/
Build: http://10.245.162.77:8080/job/charm_lint_check/10402/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #9548 percona-cluster for james-page mp271773
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/9548/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #6546 percona-cluster for james-page mp271773
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/6546/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/percona_hooks.py'
2--- hooks/percona_hooks.py 2015-08-10 16:40:24 +0000
3+++ hooks/percona_hooks.py 2015-09-21 08:06:08 +0000
4@@ -426,6 +426,9 @@
5 access_network = config('access-network')
6 db_helper = get_db_helper()
7
8+ peer_store_and_set(relation_id=relation_id,
9+ relation_settings={'access-network': access_network})
10+
11 singleset = set(['database', 'username', 'hostname'])
12 if singleset.issubset(settings):
13 # Process a single database configuration
14@@ -433,6 +436,15 @@
15 database = settings['database']
16 username = settings['username']
17
18+ normalized_address = get_host_ip(hostname)
19+ if access_network and not is_address_in_network(access_network,
20+ normalized_address):
21+ # NOTE: for configurations using access-network, only setup
22+ # database access if remote unit has presented a
23+ # hostname or ip address thats within the configured
24+ # network cidr
25+ return
26+
27 # NOTE: do this before querying access grants
28 password = configure_db_for_hosts(hostname, database, username,
29 db_helper)
30@@ -482,6 +494,16 @@
31 hostname = databases[db]['hostname']
32 username = databases[db]['username']
33
34+ normalized_address = get_host_ip(hostname)
35+ if (access_network and
36+ not is_address_in_network(access_network,
37+ normalized_address)):
38+ # NOTE: for configurations using access-network,
39+ # only setup database access if remote unit
40+ # has presented a hostname or ip address
41+ # thats within the configured network cidr
42+ return
43+
44 # NOTE: do this before querying access grants
45 password = configure_db_for_hosts(hostname, database, username,
46 db_helper)
47@@ -506,9 +528,6 @@
48 else:
49 log("No return data - not setting relation settings", level=DEBUG)
50
51- peer_store_and_set(relation_id=relation_id,
52- relation_settings={'access-network': access_network})
53-
54
55 @hooks.hook('ha-relation-joined')
56 def ha_relation_joined():

Subscribers

People subscribed via source and target branches

to status/vote changes: