sauron: strictly exit when no endpoint

The exception might be excepted, and we would continue execution. This works better after https://github.com/ElementsProject/lightning/pull/3675 which will immediately make lightningd die if we exit

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
This commit is contained in:
Antoine Poinsot
2020-04-30 10:57:39 +02:00
committed by Christian Decker
parent 8438491350
commit 810bedddc0

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import sys
import requests import requests
from art import sauron_eye from art import sauron_eye
@@ -17,6 +18,7 @@ def init(plugin, options, configuration, **kwargs):
plugin.api_endpoint = options.get("sauron-api-endpoint") plugin.api_endpoint = options.get("sauron-api-endpoint")
if not plugin.api_endpoint: if not plugin.api_endpoint:
raise SauronError("You need to specify the sauron-api-endpoint option.") raise SauronError("You need to specify the sauron-api-endpoint option.")
sys.exit(1)
plugin.log("Sauron plugin initialized") plugin.log("Sauron plugin initialized")
plugin.log(sauron_eye) plugin.log(sauron_eye)