Skip to content
This repository has been archived by the owner on Jul 14, 2020. It is now read-only.

Commit

Permalink
Log an error if OnionBalance cannot read the private key, resolves #34.
Browse files Browse the repository at this point in the history
  • Loading branch information
csucu authored and DonnchaC committed Sep 17, 2016
1 parent 800ec03 commit cfbda10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
UNRELEASED
----------

- Log error when OnionBalance does not have permission to read a private key. #34
- Fix bug loading descriptors when an address with .onion extension is listed
in the configuration file. #37
- Add support for connecting to the Tor control port over a unix domain socket.
Expand Down
6 changes: 5 additions & 1 deletion onionbalance/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,17 @@ def initialize_services(controller, services_config):
for service in services_config:
try:
service_key = util.key_decrypt_prompt(service.get("key"))
except OSError as e:
except (IOError, OSError) as e:
if e.errno == errno.ENOENT:
logger.error("Private key file %s could not be found. "
"Relative paths in the config file are loaded "
"relative to the config file directory.",
service.get("key"))
sys.exit(1)
elif e.errno == errno.EACCES:
logger.error("Permission denied to private key %s.",
service.get("key"))
sys.exit(1)
else:
raise
# Key file was read but a valid private key was not found.
Expand Down

0 comments on commit cfbda10

Please sign in to comment.