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

Handle case where user hasn't copied the config file #10

Open
steveatinfincia opened this issue Feb 21, 2015 · 0 comments
Open

Handle case where user hasn't copied the config file #10

steveatinfincia opened this issue Feb 21, 2015 · 0 comments
Assignees
Labels
Milestone

Comments

@steveatinfincia
Copy link
Member

This should be automated or improved somehow, checking to see if /etc/netrng.conf exists seems like the wrong thing to do but it would at least show an informative error about what to do.

There are config defaults included in the code, but they're really intended for cases where a user upgrades an older version of NetRNG to a new version that makes use of a newly introduced config option that isn't present in their own local config file yet.

Pythons configparser module is somewhat unfriendly in this situation as we have 3 custom sections, Global, Server, and Client to keep options properly segmented.

Example of what happens when the config file hasn't been copied at all to /etc/netrng.conf:

Traceback (most recent call last):
  File "/opt/NetRNG/bin/netrngd", line 7, in <module>
    from netrng.daemon import main
  File "/opt/NetRNG/local/lib/python2.7/site-packages/netrng/daemon.py", line 56, in <module>
    DEBUG = netrng_config.getboolean('Global', 'debug')
  File "/usr/lib/python2.7/ConfigParser.py", line 368, in getboolean
    v = self.get(section, option)
  File "/usr/lib/python2.7/ConfigParser.py", line 607, in get
    raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'Global'

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@steveatinfincia steveatinfincia self-assigned this Feb 21, 2015
@steveatinfincia steveatinfincia added this to the 0.2 milestone Feb 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant