Merge lp:~stub/charms/precise/postgresql/bug-1190141-client-access-fail into lp:charms/postgresql

Proposed by Stuart Bishop
Status: Merged
Approved by: Mark Mims
Approved revision: 69
Merged at revision: 53
Proposed branch: lp:~stub/charms/precise/postgresql/bug-1190141-client-access-fail
Merge into: lp:charms/postgresql
Prerequisite: lp:~stub/charms/precise/postgresql/tests
Diff against target: 24 lines (+8/-4)
1 file modified
hooks/hooks.py (+8/-4)
To merge this branch: bzr merge lp:~stub/charms/precise/postgresql/bug-1190141-client-access-fail
Reviewer Review Type Date Requested Status
Mark Mims (community) Approve
Review via email: mp+169928@code.launchpad.net

Description of the change

Restore basic functionality to the charm by actually granting clients access.

Tests now pass (all one of them):

$ TEST_DEBUG_FILE=debug.log TEST_TIMEOUT=600 ./test.py -vv
test_basic (__main__.PostgreSQLCharmTestCase)
__main__.PostgreSQLCharmTestCase.test_basic ... ok

----------------------------------------------------------------------
Ran 1 test in 635.891s

OK

To post a comment you must log in.
Revision history for this message
Stuart Bishop (stub) wrote :

Running the tests requires local:postgresql-psql from lp:~stub/charms/precise/postgresql-psql/devel (up for review elsewhere).

62. By Stuart Bishop

Merged tests into bug-1190141-client-access-fail.

63. By Stuart Bishop

Merged tests into bug-1190141-client-access-fail.

64. By Stuart Bishop

Merged tests into bug-1190141-client-access-fail.

65. By Stuart Bishop

Merged tests into bug-1190141-client-access-fail.

66. By Stuart Bishop

Merged tests into bug-1190141-client-access-fail.

67. By Stuart Bishop

Merged tests into bug-1190141-client-access-fail.

68. By Stuart Bishop

Merged tests into bug-1190141-client-access-fail.

69. By Stuart Bishop

Merged tests into bug-1190141-client-access-fail.

Revision history for this message
Mark Mims (mark-mims) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hooks/hooks.py'
--- hooks/hooks.py 2013-06-20 14:25:33 +0000
+++ hooks/hooks.py 2013-06-20 14:25:34 +0000
@@ -622,13 +622,17 @@
622 for relid in relation_ids(relation_types=['db', 'db-admin']):622 for relid in relation_ids(relation_types=['db', 'db-admin']):
623 local_relation = relation_get(623 local_relation = relation_get(
624 unit_name=os.environ['JUJU_UNIT_NAME'], relation_id=relid)624 unit_name=os.environ['JUJU_UNIT_NAME'], relation_id=relid)
625
626 # We might see relations that have not yet been setup enough.
627 # At a minimum, the relation-joined hook needs to have been run
628 # on the server so we have information about the usernames and
629 # databases to allow in.
630 if 'user' not in local_relation:
631 continue
632
625 for unit in relation_list(relid):633 for unit in relation_list(relid):
626 relation = relation_get(unit_name=unit, relation_id=relid)634 relation = relation_get(unit_name=unit, relation_id=relid)
627635
628 # If a relation is not yet completely setup, skip it.
629 if 'user' not in relation:
630 continue
631
632 relation['relation-id'] = relid636 relation['relation-id'] = relid
633 relation['unit'] = unit637 relation['unit'] = unit
634638

Subscribers

People subscribed via source and target branches