ffnord / mesh-announce

Discussion at #mesh-announce:irc.hackint.org and (separately) at
https://matrix.to/#/!MjLIHcALOcENXZWQlH:irc.hackint.org/$1547640760901FmKaD:matrix.eclabs.de
13 stars 45 forks source link

missing errormessage if directory does not exist #34

Closed rubo77 closed 6 years ago

rubo77 commented 6 years ago

If you specify a directory with -d that does not exist, the service runs luckily anyway, although it doesn't find any provider!

TobleMiner commented 6 years ago

Can't reproduce

sudo /opt/mesh-announce/respondd.py -d /non-existent-directory -i br-ffki -i ffki-mvpn -b bat-ffki -m 10.116.160.1
Traceback (most recent call last):
  File "/opt/mesh-announce/respondd.py", line 70, in <module>
    get_handler(get_providers(args.directory), {'batadv_dev': args.batadv_iface, 'mesh_ipv4': args.mesh_ipv4})
  File "/opt/mesh-announce/providers/__init__.py", line 150, in get_providers
    raise FileNotFoundError("The path '{}' is not a valid directory".format(directory))
FileNotFoundError: The path '/non-existent-directory' is not a valid directory
rubo77 commented 6 years ago

I used

-d /opt/mesh-announce/provider

Without s

Maybe there was an error in the log, I only checked if the sevicre was running and it was active although the path was wrong.

It should refuse to start

TobleMiner commented 6 years ago

You can't "refuse" to start. The service simply crashes as soon as it hits that error

rubo77 commented 6 years ago

strange, I think it was running before with thy typo in the path, but I cannot reproduce it now either