juju run support for executing file as script

Bug #1286517 reported by Kapil Thangavelu
30
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Expired
Medium
Unassigned
juju-core
Won't Fix
Medium
Unassigned

Bug Description

Currently juju run expects commands as bash shell script commands on the cli. But the interface for doing this is rather finicky due to string quoting, and often nescitates transfering a script over by other means before one can run it. Simple to allow for juju run to transfer an executable over and run it.

juju run --all "echo $PWD"

will just return values for the host due to shell interpreration

ie. running python needs excessive quoting.
juju run --all 'python -c "import os; print os.path.abspath(os.getcwd())"'

Better would be just

juju run --all -f myshell.sh
juju run --all -f mypy.py

which would also remove the bash assumption in juju run

Curtis Hovey (sinzui)
Changed in juju-core:
status: New → Triaged
importance: Undecided → High
tags: added: improvement run
Changed in juju-core:
importance: High → Medium
Revision history for this message
Brad Crittenden (bac) wrote :

I'll+1 Kapil's suggestion. I was pretty surprised to find out how limited 'juju run' really is.

Revision history for this message
Johan Ehnberg (johan-ehnberg) wrote :

I agree. This would fill the gap between running more advanced tuning across the cluster and creating a subordinate charm for stuff.

Revision history for this message
Anastasia (anastasia-macmood) wrote :

We will fix this for newer generation of Juju, Juju 2. we will not have a chance to address it for Juju 1 as it currently only open for Critical bugs.

From Menno:
A script should work when the executable is run via a shell.
Otherwise you'd have to call the interpreter to run the script. E.g.: juju run python /some/python/file.py

however, something does goes wrong when you run the script directly: http://paste.ubuntu.com/23346466/

Changed in juju:
status: New → Triaged
importance: Undecided → Medium
milestone: none → 2.1.0
Changed in juju-core:
status: Triaged → Won't Fix
Curtis Hovey (sinzui)
Changed in juju:
milestone: 2.1-rc2 → none
Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote :

This bug has not been updated in 5 years, so we're marking it Expired. If you believe this is incorrect, please update the status.

Changed in juju:
status: Triaged → Expired
tags: added: expirebugs-bot
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.