zhaojinhong / pdsh-ops_tools

Automatically exported from code.google.com/p/pdsh
GNU General Public License v2.0
0 stars 0 forks source link

Default value to -e from environment variable #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by william....@ubc.ca on 27 Jan 2011 at 10:50

Attachments:

GoogleCodeExporter commented 9 years ago
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)

Original comment by mark.gro...@gmail.com on 27 Jan 2011 at 11:36

GoogleCodeExporter commented 9 years ago
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!

Original comment by mark.gro...@gmail.com on 28 Jan 2011 at 12:05

GoogleCodeExporter commented 9 years ago
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.

Original comment by william....@ubc.ca on 28 Jan 2011 at 12:13

GoogleCodeExporter commented 9 years ago
Yes, ok, that makes sense. Thanks, again!

Original comment by mark.gro...@gmail.com on 28 Jan 2011 at 12:15

GoogleCodeExporter commented 9 years ago
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

Original comment by mark.gro...@gmail.com on 12 Feb 2011 at 4:02

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1272.

Original comment by mark.gro...@gmail.com on 12 Feb 2011 at 4:44

GoogleCodeExporter commented 9 years ago
Confirming this works in 2.25. Thanks!

Original comment by william....@ubc.ca on 15 Mar 2011 at 8:28

GoogleCodeExporter commented 9 years ago
Great, thanks for verifying!

Original comment by mark.gro...@gmail.com on 16 Mar 2011 at 9:00