Conversation
…tyNode look there for Gravity.ini
…ntID to simplify code
|
Thanks for looking at this @astrauc. Can you also update the Is this ready for review otherwise? |
|
Changes to have all components take in args for Gravity.ini. If the checks pass, it should be ready for review. |
|
|
||
| KeyValueConfigParser parser(config_filename, sections); | ||
| std::string path = config_dir; | ||
| if (path.rfind('/') != std::string::npos) |
There was a problem hiding this comment.
I may be missing something, but I think the logic is a little off here - the '/' isn't found if rfind returns string::npos. It should also avoid adding '/' to an empty path.
| if (path.rfind('/') != std::string::npos) | |
| if (path.size() > 0 && path.rfind('/') == std::string::npos) |
There was a problem hiding this comment.
Also, that delimiter should be updated to work on windows. If we specify c++17 or newer (which we should do anyway), we could use std::filesystem::path::preferred_separator.
|
@astrauc - The command line argument should be the full path (including filename) for the configuration INI. |
|
The arguments now take in full filepath, including filename, which should resolve both issues, since no separator needs to be added anymore. |
| //log an error indicating the componentID was missing | ||
| logger->error( | ||
| "Field 'GravityComponentID' missing from Gravity.ini, using GravityComponentID='GravityNode'"); | ||
| configSpdLoggers(); |
There was a problem hiding this comment.
This needs to be called after acquiring the initLock. We should also add a note on that method that it needs to be called within a lock.
Configurable path to Gravity.ini exists now as an environmental variable and an optional parameter to the GravityNode::init function. Init function now one function with 2 optional parameters instead of an overloaded function.
config_file.ini can be specified with command line argument now when running ConfigServer (argument is the directory to look in).