xwp / wp-cli-ssh

[OBSOLETE] Seamlessly run WP-CLI commands on a remote server via SSH
157 stars 14 forks source link

Confirm compatibility with Vagrant 1.4 #9

Closed westonruter closed 10 years ago

westonruter commented 10 years ago
jonathanbardo commented 10 years ago

@westonruter I've tested it with vagrant 1.4 and no issue came up. I think we can close this.

westonruter commented 10 years ago

@jonathanbardo does it now allow a simpler cmd than what we have right now:

vagrant ssh-config > /tmp/vagrant_ssh_config && ssh -q %pseudotty% -F /tmp/vagrant_ssh_config default %cmd%

For example something like:

vagrant ssh -c %cmd% -- -q %pseudotty%

The old vagrant ssh didn't seem to like the additional ssh arguments being supplied after -- as advertised. If this allows both TTY and piped (non-TTY) using just vagrant ssh then that would be great.

jonathanbardo commented 10 years ago

vagrant ssh -c %cmd% -- -q %pseudotty%

This does work without problem.

westonruter commented 10 years ago

Does this produce a colorized output?

wp ssh --host=vagrant plugin status

And then does this produce a non-colorized (machine-readable) output?

wp ssh --host=vagrant plugin status | cat -
mitchellh commented 10 years ago

vagrant ssh -c now uses OpenSSH under the covers, so it should be able to replace your piping thing above.

jonathanbardo commented 10 years ago

vagrant ssh -c %cmd% -- -q %pseudotty% wp ssh --host=vagrant plugin status | cat -

This combination does not produce a machine readable output.

westonruter commented 10 years ago

@mitchellh thanks for chiming in! This doesn't seem to be the case, unfortunately.

On my Vagrant 1.3, the following both echo "Non-TTY":

vagrant ssh -c 'if [ -t 1 ]; then echo TTY; else echo Non-TTY; fi' -- -t
vagrant ssh -c 'if [ -t 1 ]; then echo TTY; else echo Non-TTY; fi' -- -T

Whereas on @jonathanbardo's Vagrant 1.4 install, they both echo "TTY".

It seems that while the TTY behavior has changed with the switch to Open SSH, the SSH pseudo-TTY flags -t/-T aren't being recognized.

mitchellh commented 10 years ago

@westonruter Can you report a bug please?

westonruter commented 10 years ago

Closing since issue resolved in Vagrant 1.4.1, and old cmd with vagrant ssh-config still works regardless.