juju run doesn't work with subordinate units

Bug #1286613 reported by Kapil Thangavelu on 2014-03-01
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Marco Ceppi

Bug Description

i was trying to use juju run to debug current settings for a subordinate unit ala

$ juju run --unit=agent/0 "relation-ids ceilometer-service"
ERROR agent/0 is not a principal unit

Kapil Thangavelu (hazmat) wrote :

If we're being explicit about which unit we want to target.. i say just let the user do it.. --all can/should nanny filter subordinates, but if a user is specifically interested in running something on a subordinate i don't see the reason not to let them.

Kapil Thangavelu (hazmat) wrote :

ie. i can juju ssh/scp into a subordinate unit without issue.. i don't see why run is being restricted.

Curtis Hovey (sinzui) on 2014-03-03
Changed in juju-core:
status: New → Triaged
importance: Undecided → High
tags: added: run subordinate
Changed in juju-core:
importance: High → Medium
Robie Basak (racb) wrote :


"juju ssh service/0" gets me into the machine.
"juju-run service/0 ..." then seems to work.

On 1.20.7.

Robie Basak (racb) wrote :

Python workaround:

import subprocess

def remote_run(unit, command):
    subprocess.check_call(['juju', 'ssh', unit] + command)

def remote_run_run(unit1, unit2, command):
    remote_run(unit1, ['juju-run', unit2, "'%s'" % command])

Then I can call, for example:

    remote_run_run('main-service/0', 'subordinate-service/0', '...')

Marco Ceppi (marcoceppi) wrote :
Changed in juju-core:
status: Triaged → Fix Committed
assignee: nobody → Marco Ceppi (marcoceppi)
Curtis Hovey (sinzui) on 2014-09-22
Changed in juju-core:
milestone: none → 1.21-alpha2
Curtis Hovey (sinzui) on 2014-10-23
Changed in juju-core:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers