Merge lp://staging/~jimbaker/pyjuju/ssh-passthrough into lp://staging/pyjuju
Proposed by
Jim Baker
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Kapil Thangavelu | ||||
Approved revision: | 412 | ||||
Merged at revision: | 420 | ||||
Proposed branch: | lp://staging/~jimbaker/pyjuju/ssh-passthrough | ||||
Merge into: | lp://staging/pyjuju | ||||
Diff against target: |
393 lines (+219/-17) 6 files modified
juju/control/__init__.py (+20/-4) juju/control/command.py (+2/-1) juju/control/ssh.py (+32/-9) juju/control/tests/test_ssh.py (+64/-2) juju/control/tests/test_utils.py (+48/-1) juju/control/utils.py (+53/-0) |
||||
To merge this branch: | bzr merge lp://staging/~jimbaker/pyjuju/ssh-passthrough | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Kapil Thangavelu (community) | Approve | ||
William Reade (community) | Approve | ||
Review via email: mp+79888@code.staging.launchpad.net |
Description of the change
Implements the ability to passthrough args to an underlying command, in particular to support juju ssh. This support enables using juju ssh in the following ways:
$ juju ssh mysql/0 ls /
$ juju ssh -L8080:localhost:80 wordpress/0
and so forth, any options are simply passed through, along with the ssh command.
This requires working around argparse a bit, but only through its public API. In particular, main now uses parse_known_args to see if the command module in question supports the passthrough function; it if it does, that function is used to further decorate options from any extra args. Then command execution proceeds as before.
To post a comment you must log in.
[0] trivial
+ "[passthru ssh options] unit_or_machine [command]"),
s/passthru/ passthrough
[1] trivial
+ # workding with ssh, for example), so consume the rest and
s/workding/working
[2] less trivial
I didn't see any way to handle potential conflicts in args (specifically -o ControlMaster/ ControlPath, which I think are the only ones we need to worry about at the moment). Not really a big deal, but something it might be worth logging a "low" bug against, to make it clear that the limitation is known but not a priority?
anyway, +1