Opened 18 years ago
Last modified 18 years ago
#1100 new enhancement
addstar fails before parsing options unless .ptolemyrc points to a valid dvo.config, even if a valid dvo.config is pointed to on the command line
| Reported by: | Owned by: | eugene | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | Ohana | Version: | 2.5 |
| Severity: | minor | Keywords: | |
| Cc: |
Description
I had a typo in my ~/.ptolemyrc (misspelled a config directory). As far as I could tell with the help of a debugger, addstar tries to read the configuration pointed to by ~/.ptolemyrc before parsing its options. The misspelled directory in .ptolemyrc made addstar fail (because it requires an ADDSTAR_RADIUS or RADIUS) before it even parses the command-line options. I.e. without a valid, working .ptolemyrc, you can't even find out what the command-line arguments to addstar are, nor can you specify a different, valid configuration on the commandline.
The suggested fix would be to read the default configuration *after* option parsing.
Change History (2)
comment:1 by , 18 years ago
comment:2 by , 18 years ago
Maybe you'll say: Ah, but Ohana/src/addstar/src/ConfigInit.c *checks* whether a config file exists before it tries to read it!
Correct... except for files that get read by "input". That's done in Ohana/src/libohana/src/config.c:389 and if the requested file doesn't exist, it just quietly returns without any complaint.
So I believe the correct behaviour would be to throw the same error as at Ohana/src/addstar/src/ConfigInit.c:18
I'm happy to implement that, but will wait for a go-ahead - I don't want to break anything else that might depend on that behaviour.

Also, the error message "error in config, cannot find RADIUS" is totally misleading, it looks like it's reading a config file. Why not say "could not find configuration file/directory ..." ?