GithubHelp home page GithubHelp logo

Comments (12)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
Thanks for the report and the patch.

I have been thinking about this one and unfortunately I'd like to keep
the current functionality of PDSH_SSH_ARGS as it is very useful for testing
and since it crept into a couple of releases.

However, you have very valid points about the change in behavior and the 
incorrect
documentation. (The %u %h %n parameters are documented only in the section
about the rcmd/exec module).

What I'd like to try, if it is ok with you, is to scan PDSH_SSH_ARGS if supplied
for %u and %h, and if they are not found, then append "-l%u" and "%h" to the
ssh arguments. It is not ideal, but in that way we can hopefully preserve both
the new and old behavior. (I would like to allow users some way to override 
*all*
the ssh args)

I'll work on a proposed patch later today. I am sorry, and I really appreciate 
that
you attach patches to your bug reports (I don't want to discourage that!) :-)

Original comment by [email protected] on 27 Apr 2011 at 8:29

  • Changed state: Accepted

from pdsh.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
Oh, I will also update documentation.

Original comment by [email protected] on 27 Apr 2011 at 8:30

from pdsh.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
Yeah, when reading the code revisions I had seen that
the ssh string had been factored out to use the same
code as the new ``-R exec`` module.  That sort of makes
sense except that the code became broken for its
previously intended use :-)

I tried building new packages with it and see the test
suite failure... test 8 relies on::

    OUTPUT=$(PDSH_SSH_ARGS="ssh -p 922 -l%u %h" pdsh \
    -luser -Rssh -wfoo hostname)

but this is again the same string anyways (``-l%u %h``)
so that portion of the string could just be removed
from the test after the reverting to the old behavior.

However, I do agree that not being able to specify the
whole thing in the first place and hardcoding it is bad.

I think scanning the string for format characters may
be a hack; either a new $PDSH_SSH_FMTARGS should be
made or just keep the behavior from trunk and document
it.  It's ok to break stuff if it's better...
downstream can always deal with that :-) We are lucky
after all to have source to begin with.

I can make a try at a PDSH_SSH_FMTARGS if you like that
approach, or I'll just make site-local packages until
I'm ready to update all my shell profiles.

Thanks for looking at this and considering all the
options.

-- 
Scott

Original comment by [email protected] on 27 Apr 2011 at 8:53

from pdsh.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
btw ``PDSH_SSH_ARGS`` as a name does not make sense
anyways for the current behavior; they aren't just
arguments but also include the executable name ``ssh``.
It's actually a whole command string.

They *were* "just arguments" before.  I think just a
new environment variable altogether should be used for
the current behavior, but either way does make sense.

Original comment by [email protected] on 27 Apr 2011 at 9:00

from pdsh.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
oh and also, thinking more about it: scanning for a
format character might actually not be so bad because
if they were not supplied, they would *have* to be
provided by pdsh or the resulting command would be
broken, but if any were supplied then the user would
almost certainly be supplying the whole command line.

btw my patch also makes ``PDSH_SSH_ARGS_APPEND`` be
appended to ``PDSH_SSH_ARGS`` which I don't think was
old behavior but seems to make sense semantically.

Original comment by [email protected] on 27 Apr 2011 at 9:04

from pdsh.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
> btw my patch also makes ``PDSH_SSH_ARGS_APPEND`` be
> appended to ``PDSH_SSH_ARGS`` which I don't think was
> old behavior but seems to make sense semantically.

Ah, yes that is a bug there. I'm going to open a separate issue
on that one.

Original comment by [email protected] on 27 Apr 2011 at 9:05

from pdsh.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
> > btw my patch also makes ``PDSH_SSH_ARGS_APPEND`` be
> > appended to ``PDSH_SSH_ARGS`` which I don't think was
> > old behavior but seems to make sense semantically.

> Ah, yes that is a bug there. I'm going to open a separate issue
> on that one.

Hm, actually do you mean PDSH_SSH_ARGS_APPEND are *prepended*? Yeah, that was
a compromise I had to make at some point. Assuming the argument order doesn't
matter it shouldn't be a problem, but I agree that it is not intuitive for sure.

mark

Original comment by [email protected] on 27 Apr 2011 at 9:08

from pdsh.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
> I think scanning the string for format characters may
> be a hack; either a new $PDSH_SSH_FMTARGS should be
> made or just keep the behavior from trunk and document
> it.  It's ok to break stuff if it's better...
> downstream can always deal with that :-) We are lucky
> after all to have source to begin with.
>
> I can make a try at a PDSH_SSH_FMTARGS if you like that
> approach, or I'll just make site-local packages until
> I'm ready to update all my shell profiles.
>

I kind of agree it is a hack but I'm also not thrilled about adding yet
another environment variable. I'll give the code an attempt and if it doesn't
work out we'll do the alternate env variable.

Future plans for the ssh module is to transition all 'exec' type rcmd
modules to using a config file instead of coding them up as DSOs. The rough
idea is that you'd have a config something like

 exec-module "ssh" {
   cmdline = "ssh -2 -a -x -l%u %h"
 }

so that sites will be able to easily modify the ssh arguments. I might even work
on some way to have exec-modules define new pdsh options. Anyhow, this is why
ssh was transitioned to using the pipecmd code. Sorry that it broke a bunch of
things.

Original comment by [email protected] on 27 Apr 2011 at 9:20

from pdsh.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
Ok, attached is the first attempt at scanning for %u and %h in PDSH_SSH_ARGS.
If they are not found then the code appends them.
(Note this patch breaks part of the t2001-ssh.sh tests -- to be fixed
in a subsequent commit)

mark

Original comment by [email protected] on 27 Apr 2011 at 10:48

Attachments:

from pdsh.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
like the future direction indicated.  It abstracts out
into kind of a generic threaded popen(3) command
processor.  Maybe a different module could be made to
build ssh support in directly with something like
libssh.org...  that might help for doing stdin copying.
Then again maybe that's useful for exec module too...

Anyways, your patch looks sane, built and ran fine with
no changes to my profiles needed anymore.  Thanks!

Original comment by [email protected] on 28 Apr 2011 at 10:29

from pdsh.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
This issue was updated by revision r1329.


Tests for optional use of %u and %h in PDSH_SSH_ARGS.

Original comment by [email protected] on 28 Apr 2011 at 2:34

from pdsh.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
This issue was closed by revision r1330.

Original comment by [email protected] on 28 Apr 2011 at 2:34

  • Changed state: Fixed

from pdsh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.