fix: actions need hooks/

Some charm builds will put additional functionality into a subdirectory
of hooks/ (eg designate-bind creates a hooks/relations directory.)

However, when running an action, those are run from "actions/pause" not
as "hooks/config-changed". Which means that they cannot find the
"relations" directory to import it.

We could:
a) symlink all the extra things from actions/* to point at hooks/*
b) include hooks as part of the import path
c) change so that all of those extra libraries are put into somewhere in
'lib' instead of somewhere in hooks/*.

This patch chooses (b).

This should fix:
https://bugs.launchpad.net/charm-designate-bind/+bug/2107591

once it is rebuilt with this version of layer openstack.

Closes-Bug: 2107591
Change-Id: Ib1f0893bbff00ffc28a80162dd5472bfb64a3033
Signed-off-by: Arif Ali <arif-ali@ubuntu.com>
This commit is contained in:
John A Meinel
2026-05-19 16:30:31 +01:00
committed by Arif Ali
parent 7c671b0696
commit cb0cb32156
3 changed files with 5 additions and 1 deletions
+3
View File
@@ -18,6 +18,9 @@ import sys
# Load modules from $CHARM_DIR/lib
sys.path.append('lib')
# Some charms include extra functionality in the hooks/ directory
# Load modules from $CHARM_DIR/hooks (eg hooks/relations)
sys.path.append('hooks')
from charms.layer import basic
basic.bootstrap_charm_deps()
+1 -1
View File
@@ -1,4 +1,4 @@
# Requirements to build the layer
charm-tools
git+https://github.com/juju/charm-tools.git
simplejson
flake8
+1
View File
@@ -9,3 +9,4 @@ netifaces>=0.10.4
psutil
# charms_openstack - pull from github until first release
git+https://github.com/openstack/charms.openstack.git#egg=charms.openstack
pbr>=6.1.1