Merge lp:~free.ekanayaka/landscape-charm/run-schema-script into lp:landscape-charm

Proposed by Free Ekanayaka on 2015-02-05
Status: Merged
Approved by: Free Ekanayaka on 2015-02-10
Approved revision: no longer in the source branch.
Merged at revision: 225
Proposed branch: lp:~free.ekanayaka/landscape-charm/run-schema-script
Merge into: lp:landscape-charm
Diff against target: 0 lines
To merge this branch: bzr merge lp:~free.ekanayaka/landscape-charm/run-schema-script
Reviewer Review Type Date Requested Status
Chad Smith 2015-02-05 Approve on 2015-02-10
Björn Tillenius 2015-02-05 Approve on 2015-02-10
Review via email: mp+248798@code.launchpad.net

Commit message

Add a SchemaBootstrap callback that will be invoked after all
relations are ready, and that will run "schema --bootstrap" to
set up our databases and the landscape PostgreSQL user.

Description of the change

Add a SchemaBootstrap callback that will be invoked after all relations are ready, and that will run "schema --bootstrap" to set up our databases and the landscape PostgreSQL user.

To test it:

mkdir trusty
cd trusty
ln -s ../path/to/run-schema-script landscape-server
cd ..
cat<<EOF > landscape-server.yaml
landscape-server:
    source: deb https://landscape-builder:<email address hidden>/landscape/lds-trunk/ubuntu trusty main
    key: 4652B4E6
EOF
juju deploy local:landscape-server --config landscape-server.yaml
juju deploy postgresql
juju add-relation landscape-server:db postgresql:db-admin

and wait for hooks to settle. Then:

juju ssh landscape-server/0

and use the connection details in /etc/landscape/service.conf to connect to PostgreSQL by hand with psql as landscape user, e.g.:

psql -h 10.0.3.43 -U landscape -W landscape-main

and check that the schema is there.

To post a comment you must log in.
Björn Tillenius (bjornt) wrote :

Looks good, +1.

review: Approve
Chad Smith (chad.smith) wrote :

[1] Unrelated to this branch: the rework in rev 220 broke the lint makefile target, this breaks charm store automated testing that is done which exercises lint targets if they exist for a charm. We need to avoid trying to lint tests dir which no longer exists, and we should ignore charmhelpers and old subdirs in our lints.

=== modified file 'Makefile'
--- Makefile revid:<email address hidden>
+++ Makefile 2015-02-10 10:55:08 +0000
@@ -36,9 +36,9 @@

 lint:
  flake8 --exclude=charmhelpers hooks
- pyflakes3 tests dev/update-charm-revision-numbers
- find . -name *.py -print0 | xargs -0 pep8
- pep8 tests dev/update-charm-revision-numbers
+ pyflakes3 dev/update-charm-revision-numbers
+ find . -name *.py -not -path "./old/*" -not -path "*/charmhelpers/*" -print0 | xargs -0 pep8
+ pep8 dev/update-charm-revision-numbers

 clean: clean-integration-test

+1 on charm changes.

review: Approve
Free Ekanayaka (free.ekanayaka) wrote :

Thanks Chad, [1] fixed.

Preview Diff

Empty

Subscribers

People subscribed via source and target branches