Export to GitHub

pdsh - issue #7

Default value to -e from environment variable


Posted on Jan 27, 2011 by Happy Hippo

It would be handy to be able to provide a default value for the -e option to pdcp/rdcp from an environment variable. Patch attached relative to trunk r1260.

Attachments

Comment #1

Posted on Jan 27, 2011 by Happy Ox

Nice. Looks like you even fixed a bug that would let the environment variable for MISC_MODULES override the command line. Thanks!

I'll apply this soon, but likely as two separate patches (one to fix the PDSH_MISC_MODULES handling, and one for PDSH_REMOTE_PDCP_PATH)

Comment #2

Posted on Jan 28, 2011 by Happy Ox

Hm, actually I confused myself, opt_env() was always called before opt_args and opt_args early. Was there a reason you moved opt_env() after mod_init() and created an opt_env_early()? I'm sure there is, and I don't have any problem with it, but I can't quite see why it is necessary (here at the end of the day)

Thanks!

Comment #3

Posted on Jan 28, 2011 by Happy Hippo

Only the new bit concerning PDSH_REMOTE_PDCP_PATH has to run after mod_init(). Otherwise, _mod_load_dynamic_modules() fails to locate the local binary. I didn't have any particular reason to move the other options into the "late" opt_env rather than leave them in opt_env_early - it was just the way I happened to copy-paste the bits around.

Comment #4

Posted on Jan 28, 2011 by Happy Ox

Yes, ok, that makes sense. Thanks, again!

Comment #5

Posted on Feb 12, 2011 by Happy Ox

Since the use of opt->path_progname for both local and remote paths was confusing even to me, I separated them in the options structure. This simplified your patch a bit since we no longer need opt_env_early().

I'll commit the patch soon, at which point it would be great if you could verify it does what you need.

Thanks again, mark

Comment #6

Posted on Feb 12, 2011 by Happy Ox

This issue was closed by revision r1272.

Comment #7

Posted on Mar 15, 2011 by Happy Hippo

Confirming this works in 2.25. Thanks!

Comment #8

Posted on Mar 16, 2011 by Happy Ox

Great, thanks for verifying!

Status: Verified

Labels:
Type-Enhancement Priority-Medium