Merge ~kos.tsakalozos/charm-graylog:master into ~graylog-charmers/charm-graylog:master

Proposed by Konstantinos Tsakalozos
Status: Merged
Approved by: Tom Haddon
Approved revision: 09296a7cedc2e24208e22e0c76204b4884b97bfd
Merged at revision: 55adc8c0826dc05c6ff6f85f34f63c952d8c48b2
Proposed branch: ~kos.tsakalozos/charm-graylog:master
Merge into: ~graylog-charmers/charm-graylog:master
Diff against target: 10 lines (+1/-1)
1 file modified
actions/actions.py (+1/-1)
Reviewer Review Type Date Requested Status
Stuart Bishop (community) Approve
Review via email: mp+341517@code.launchpad.net

Commit message

Use charm-env to have access to venv in actions

Description of the change

The base layer changed recently its default behaviour that had to do with venvs [1]. By default venv [2] is now set to true.

As a result the charm actions now need to use the charms venv to have access to for example charmhelpers.

Without this patch actions fail with:

'''
2018-03-16 11:19:34 DEBUG show-admin-password Traceback (most recent call last):
2018-03-16 11:19:34 DEBUG show-admin-password File "/var/lib/juju/agents/unit-g2-0/charm/actions/show-admin-password", line 16, in <module>
2018-03-16 11:19:34 DEBUG show-admin-password from charms import reactive # noqa E402
2018-03-16 11:19:34 DEBUG show-admin-password ImportError: cannot import name 'reactive'
'''

[1] https://github.com/juju-solutions/layer-basic/commit/ce824a7af99134a9cd2a1bca98b3b85983d60e56
[2] https://charmsreactive.readthedocs.io/en/latest/layer-basic.html#layer-configuration

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

Yes, this is the preferred solution.

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 55adc8c0826dc05c6ff6f85f34f63c952d8c48b2

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/actions/actions.py b/actions/actions.py
2index 81d817c..eed1233 100755
3--- a/actions/actions.py
4+++ b/actions/actions.py
5@@ -1,4 +1,4 @@
6-#!/usr/bin/python3
7+#!/usr/local/sbin/charm-env python3
8
9 import os
10 import sys

Subscribers

People subscribed via source and target branches