juju scp should accept multiple targets and pass extra args to scp
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
juju-core |
Fix Released
|
Low
|
Dimiter Naydenov |
Bug Description
OpenSSH scp command supports multiple source and destination targets, like:
scp user1@host1:
Juju scp command only parses the first and second argument and interprets them as source/destination. If should miminc scp more closely by accepting multiple remote and/or local paths, so that the above can be called as:
$ juju scp ubuntu/
(assuming we have machine 0 and unit ubuntu/0 deployed on machine 1, and the local remote-logs dir exists)
The expected result is the command to succeed and both logs should appear in remote-logs/, but instead in trunk the result is:
ERROR exit status 1 (Warning: Permanently added 'ec2-54-
Host key verification failed.
lost connection)
Also, even though juju scp's help says it supports passing extra arguments to scp, by giving them after --, like:
juju scp -- -r mongodb/
In fact the implementation does not parse or forward any extra arguments in a way scp can understand:
$ juju scp -- -r 0:/var/log/juju remote-logs/
The expected result is scp succeeds and recursively copies the /var/log/juju dir to remote-logs/, but instead:
ERROR exit status 1 (usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
[-l limit] [-o ssh_option] [-P port] [-S program]
Related branches
- Adam Collard (community): Needs Fixing
- Juju Engineering: Pending requested
-
Diff: 662 lines (+185/-87)12 files modifiedcmd/juju/addmachine.go (+1/-0)
cmd/juju/debughooks_test.go (+2/-2)
cmd/juju/scp.go (+34/-12)
cmd/juju/scp_test.go (+40/-11)
cmd/juju/ssh.go (+10/-8)
cmd/juju/ssh_test.go (+12/-18)
utils/ssh/run_test.go (+1/-1)
utils/ssh/ssh.go (+15/-7)
utils/ssh/ssh_gocrypto.go (+2/-1)
utils/ssh/ssh_gocrypto_test.go (+1/-1)
utils/ssh/ssh_openssh.go (+48/-14)
utils/ssh/ssh_test.go (+19/-12)
Changed in juju-core: | |
milestone: | none → 1.17.4 |
Changed in juju-core: | |
status: | In Progress → Fix Committed |
Changed in juju-core: | |
status: | Fix Committed → Fix Released |