jneo8 / charm-userdir-ldap

Other
0 stars 0 forks source link

"python-hosts" missing dependency #1

Open jneo8 opened 10 months ago

jneo8 commented 10 months ago

On Jammy install fails with python_hosts module missing

2023-05-15 14:03:37 WARNING unit.ud-ldap-standalone/1.install logger.go:60 Traceback (most recent call last):
2023-05-15 14:03:37 WARNING unit.ud-ldap-standalone/1.install logger.go:60   File "/var/lib/juju/agents/unit-ud-ldap-standalone-1/charm/hooks/install.real", line 26, in <module>
2023-05-15 14:03:37 WARNING unit.ud-ldap-standalone/1.install logger.go:60     import utils
2023-05-15 14:03:37 WARNING unit.ud-ldap-standalone/1.install logger.go:60   File "/var/lib/juju/agents/unit-ud-ldap-standalone-1/charm/hooks/utils.py", line 23, in <module>
2023-05-15 14:03:37 WARNING unit.ud-ldap-standalone/1.install logger.go:60     from python_hosts.hosts import Hosts, HostsEntry
2023-05-15 14:03:37 WARNING unit.ud-ldap-standalone/1.install logger.go:60 ModuleNotFoundError: No module named 'python_hosts.hosts'
2023-05-15 14:03:37 ERROR juju.worker.uniter.operation runhook.go:180 hook "install" (via explicit, bespoke hook script) failed: exit status 1
2023-05-15 14:04:49 DEBUG unit.ud-ldap-standalone/1.install logger.go:60 Hit:1 http://security.ubuntu.com/ubuntu jammy-security InRelease

workaround is to run on the unit

pip install python-hosts


Imported from Launchpad using lp2gh.

jneo8 commented 10 months ago

(by pjdc) There was an attempted fix for this committed for bug 2012099, but the results don't appear in the charmhub-published version on edge (15) perhaps because the fix was implemented via a Makefile, which charmcraft.yaml (and therefore the Launchpad builders) do not invoke.

I'm currently running from a local charm generated with "make build", which works nicely.

The suggested workaround is not ideal for most of our environments because egress traffic is strictly filtered.