-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix running RMSExternalScript manually on machines with multiple stations #143
base: master
Are you sure you want to change the base?
Conversation
Confirms that confirmation that a file really exists when a config ile is provided in 'cml_args_config' parameters and raise an exception if not. Also fixes an unwanted exception that occurs when FileNotFoundError exception is raised.
Add --config/-c parameter that can be used to provide a different RMS configuration file instead of using the default one. This is useful when there are multiple stations running on the same machine.
@dvida , I'm not sure about the default behavior, I would like to help user avoid mistakes when running it manually. When a config file is not specified, I would like to suggest one of the solutions bellow (or one you and other may come up with): I'd vote option b :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the try/except block is needed in RunExternalScript, since ConfigReader already handles missing files and will actually exit().
The current behaviour of RunExternalScript is to load the config file from ~/source/RMS. I think this should not be changed to as otherwise it could cause backward compatability issues for anyone who is using the module already.
I agree with Mark's comments, the default behavior should be preserved. I.e. if a config file is not specified, use the one in ~/source/RMS. |
There's no intention of changing the default behavior on this change: when --config parameter is not used (default case), a 'None' object is passed to loadConfigFromDirectory(), then ConfigReader will use the already existing logic[1] to load the default ".config" file (This is similar to the original config file load code in RMSExternalScript) The try/except block is needed because when a config file is provided and the file is not found it raises a FileNotFoundError exception that need to be handled, otherwise user will get the unhandled exception stack trace instead of a friendly error message. (I added it to the FileNotFound exception to keep consistent with the code just above that raises the exception when default file is not found) The original idea was to always load the config file from "data" directory following the '.' behavior in [2]. I think it would be ideal but it would change default behavior for sure. [1] Line 198 in c3b5b64
[2] Line 165 in c3b5b64
|
Adds --config/-c parameter that can be used to provide a different RMS configuration file instead of using the default one. This is
useful when there are multiple stations running on the same machine.
Also fixes an error handling when the provided config file is not found.
Reported by: William Schauff and Washington Oliveira