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
=== modified file 'hooks/percona_hooks.py'
--- hooks/percona_hooks.py 2015-08-10 16:40:24 +0000
+++ hooks/percona_hooks.py 2015-09-21 08:06:08 +0000
@@ -426,6 +426,9 @@
426 access_network = config('access-network')426 access_network = config('access-network')
427 db_helper = get_db_helper()427 db_helper = get_db_helper()
428428
429 peer_store_and_set(relation_id=relation_id,
430 relation_settings={'access-network': access_network})
431
429 singleset = set(['database', 'username', 'hostname'])432 singleset = set(['database', 'username', 'hostname'])
430 if singleset.issubset(settings):433 if singleset.issubset(settings):
431 # Process a single database configuration434 # Process a single database configuration
@@ -433,6 +436,15 @@
433 database = settings['database']436 database = settings['database']
434 username = settings['username']437 username = settings['username']
435438
439 normalized_address = get_host_ip(hostname)
440 if access_network and not is_address_in_network(access_network,
441 normalized_address):
442 # NOTE: for configurations using access-network, only setup
443 # database access if remote unit has presented a
444 # hostname or ip address thats within the configured
445 # network cidr
446 return
447
436 # NOTE: do this before querying access grants448 # NOTE: do this before querying access grants
437 password = configure_db_for_hosts(hostname, database, username,449 password = configure_db_for_hosts(hostname, database, username,
438 db_helper)450 db_helper)
@@ -482,6 +494,16 @@
482 hostname = databases[db]['hostname']494 hostname = databases[db]['hostname']
483 username = databases[db]['username']495 username = databases[db]['username']
484496
497 normalized_address = get_host_ip(hostname)
498 if (access_network and
499 not is_address_in_network(access_network,
500 normalized_address)):
501 # NOTE: for configurations using access-network,
502 # only setup database access if remote unit
503 # has presented a hostname or ip address
504 # thats within the configured network cidr
505 return
506
485 # NOTE: do this before querying access grants507 # NOTE: do this before querying access grants
486 password = configure_db_for_hosts(hostname, database, username,508 password = configure_db_for_hosts(hostname, database, username,
487 db_helper)509 db_helper)
@@ -506,9 +528,6 @@
506 else:528 else:
507 log("No return data - not setting relation settings", level=DEBUG)529 log("No return data - not setting relation settings", level=DEBUG)
508530
509 peer_store_and_set(relation_id=relation_id,
510 relation_settings={'access-network': access_network})
511
512531
513@hooks.hook('ha-relation-joined')532@hooks.hook('ha-relation-joined')
514def ha_relation_joined():533def ha_relation_joined():

Subscribers

People subscribed via source and target branches

to status/vote changes: