Skip to content
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

Fixed search strategy for python_logging config #1292

Merged
merged 2 commits into from
Feb 1, 2018

Conversation

mgrrx
Copy link
Contributor

@mgrrx mgrrx commented Jan 1, 2018

The current strategy tries to first find a file named python_logging.conf and, in case none was found, continues searching the yaml version.
A custom configuration in /etc/ros/python_logging.yaml would be ignored as the file python_logging.conf is always present in the share/conf folder of rosgraph.

@mgrrx mgrrx force-pushed the fix-search-for-logging-config branch from 94fd2ab to 14fb677 Compare January 1, 2018 20:32
Copy link
Member

@mikepurvis mikepurvis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable, but can you describe more about how you verified the new and existing behaviour?

'/etc/ros/%s'%(fname),
os.path.join(rosgraph_d, 'conf', fname)]:
for config_dir in [os.path.join(rospkg.get_ros_home(), 'config'),
'/etc/ros/',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use get_etc_ros_dir, since that accounts for the ROS_ETC_DIR envvar:

http://docs.ros.org/independent/api/rospkg/html/rospkg_environment.html#get_etc_ros_dir

for config_dir in [os.path.join(rospkg.get_ros_home(), 'config'),
'/etc/ros/',
os.path.join(rosgraph_d, 'conf')]:
for extension in ['.conf', '.yaml', '.yml']:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider os.extsep, but it isn't used a lot elsewhere in ROS tooling, and . works on all of the supported ROS platforms.

@mgrrx mgrrx force-pushed the fix-search-for-logging-config branch from 14fb677 to bb77dc9 Compare January 2, 2018 17:50
@mgrrx
Copy link
Contributor Author

mgrrx commented Jan 2, 2018

Updated as suggested. I played a bit and placed files here and there. And from the code it was somehow obvious that when a file is found, the search ends.

@mikepurvis
Copy link
Member

👍

@dirk-thomas
Copy link
Member

I don't think we need to introduce the option for yml. Support yaml should be sufficient. Therefore I removed it in 9801667.

Thank you for the patch. This order makes much more sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants