Merge lp:~gnuoy/charms/trusty/percona-cluster/bug-1389670take2 into lp:~openstack-charmers-archive/charms/trusty/percona-cluster/trunk

Proposed by Liam Young
Status: Work in progress
Proposed branch: lp:~gnuoy/charms/trusty/percona-cluster/bug-1389670take2
Merge into: lp:~openstack-charmers-archive/charms/trusty/percona-cluster/trunk
Diff against target: 51 lines (+7/-6)
1 file modified
hooks/percona_hooks.py (+7/-6)
To merge this branch: bzr merge lp:~gnuoy/charms/trusty/percona-cluster/bug-1389670take2
Reviewer Review Type Date Requested Status
Edward Hope-Morley Needs Fixing
charmers Pending
Review via email: mp+247509@code.launchpad.net

Description of the change

Don't store the allowed_units info in the peerdb as the information is available directly from the db

To post a comment you must log in.
Revision history for this message
Edward Hope-Morley (hopem) :
review: Needs Fixing
Revision history for this message
Edward Hope-Morley (hopem) :
review: Needs Fixing

Unmerged revisions

44. By Liam Young

Fix local variable 'allowed_units' referenced before assignment

43. By Liam Young

Dont store allowed units in peerdb

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 2014-12-17 18:59:55 +0000
+++ hooks/percona_hooks.py 2015-01-24 12:53:28 +0000
@@ -23,7 +23,6 @@
23from charmhelpers.core.host import (23from charmhelpers.core.host import (
24 service_restart,24 service_restart,
25 file_hash,25 file_hash,
26 write_file,
27 lsb_release,26 lsb_release,
28)27)
29from charmhelpers.core.templating import render28from charmhelpers.core.templating import render
@@ -287,8 +286,8 @@
287 db_host = get_db_host(hostname)286 db_host = get_db_host(hostname)
288 peer_store_and_set(relation_id=relation_id,287 peer_store_and_set(relation_id=relation_id,
289 db_host=db_host,288 db_host=db_host,
290 password=password,289 password=password)
291 allowed_units=allowed_units)290 relation_set(relation_id=relation_id, allowed_units=allowed_units)
292 else:291 else:
293 # Process multiple database setup requests.292 # Process multiple database setup requests.
294 # from incoming relation data:293 # from incoming relation data:
@@ -317,6 +316,7 @@
317 databases[db][x] = v316 databases[db][x] = v
318317
319 return_data = {}318 return_data = {}
319 allowed_units = []
320 for db in databases:320 for db in databases:
321 if singleset.issubset(databases[db]):321 if singleset.issubset(databases[db]):
322 database = databases[db]['database']322 database = databases[db]['database']
@@ -334,9 +334,9 @@
334 password = configure_db(hostname, database, username)334 password = configure_db(hostname, database, username)
335335
336 return_data['_'.join([db, 'password'])] = password336 return_data['_'.join([db, 'password'])] = password
337 return_data['_'.join([db, 'allowed_units'])] = \337 allowed_units = unit_sorted(get_allowed_units(database,
338 " ".join(unit_sorted(get_allowed_units(database,338 username))
339 username)))339 allowed_units = ' '.join(allowed_units)
340 db_host = get_db_host(hostname)340 db_host = get_db_host(hostname)
341341
342 if len(return_data) > 0:342 if len(return_data) > 0:
@@ -344,6 +344,7 @@
344 **return_data)344 **return_data)
345 peer_store_and_set(relation_id=relation_id,345 peer_store_and_set(relation_id=relation_id,
346 db_host=db_host)346 db_host=db_host)
347 relation_set(relation_id=relation_id, allowed_units=allowed_units)
347348
348 peer_store_and_set(relation_id=relation_id,349 peer_store_and_set(relation_id=relation_id,
349 relation_settings={'access-network': access_network})350 relation_settings={'access-network': access_network})

Subscribers

People subscribed via source and target branches

to status/vote changes: