client-relation-joined hook failes on Juju 1.25 because network-get is called
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Elasticsearch Charm |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
When running Juju 1.25.x, the hook client-
Traceback (most recent call last):
File "./hooks/
hooks.
File "/var/lib/
self.
File "/var/lib/
subprocess.
File "/usr/lib/
raise CalledProcessEr
subprocess.
root@juju-
network-get: command not found
From a Juju 2.x model:
root@elastic-
./2.3.7-
./2.4.1-
Looks like the network-get tool is introduced in Juju 2, and so the Elasticsearch charm as it stands doesn't support 1.25.
Is this something we want to fix?
This might be a quick fix:
--- a/playbook.yaml relation- joined primary_ address
+++ b/playbook.yaml
@@ -65,7 +65,8 @@
- name: Get the primary address of client relation
tags:
- client-
- command: network-get client --primary-address
+ command: >
+ bash -c 'network-get client --primary-address 2>/dev/null || unit-get private-address'
register: client_
But it's untested, and I'm not sure what the *next* problem would be with ES on 1.25.