canonical / charm-lldpd

LLDPd charm
Other
1 stars 8 forks source link

Charm fails on Focal - leader-elected hooks traceback #5

Closed ChrisMacNaughton closed 4 years ago

ChrisMacNaughton commented 4 years ago

2020-06-08 12:00:52 DEBUG juju.worker.uniter.runner runner.go:595 starting jujuc server {unix @/var/lib/juju/agents/unit-lldpd-0/agent.socket } 2020-06-08 12:00:53 DEBUG leader-elected Traceback (most recent call last): 2020-06-08 12:00:53 DEBUG leader-elected File "/var/lib/juju/agents/unit-lldpd-0/charm/hooks/leader-elected", line 26, in 2020-06-08 12:00:53 DEBUG leader-elected from charmhelpers import fetch # noqa: E402 2020-06-08 12:00:53 DEBUG leader-elected File "/usr/local/lib/python3.8/dist-packages/charmhelpers/fetch/init.py", line 75, in 2020-06-08 12:00:53 DEBUG leader-elected platform = get_platform() 2020-06-08 12:00:53 DEBUG leader-elected File "/usr/local/lib/python3.8/dist-packages/charmhelpers/osplatform.py", line 11, in get_platform 2020-06-08 12:00:53 DEBUG leader-elected tuple_platform = platform.linux_distribution() 2020-06-08 12:00:53 DEBUG leader-elected AttributeError: module 'platform' has no attribute 'linux_distribution' 2020-06-08 12:00:53 ERROR juju.worker.uniter.operation runhook.go:132 hook "leader-elected" failed: exit status 1

ChrisMacNaughton commented 4 years ago

This seems to happen when there is a system level charmhelpers install

ivoks commented 4 years ago

Since we are appending lib/ to sys.path, existing charmhelpers takes precedence.

ivoks commented 4 years ago

@xavpaice I'll update this to use sys.path.insert(), but you should look into your template for other charms as well.

ivoks commented 4 years ago

Resolved with commit 0f9a7ddf. I'll push the new charm after all tests finish successfully.