diff sat/core/sat_main.py @ 3634:3c7a64d6f49f

bridge: bridge can now be set using environment variable: The `LIBERVIA_BRIDGE_NAME` environment variable can now be used to specify the bridge to use. If set and different from empty string, the environment has precedence over config file value. For `pb` bridge, the following environment variable can also be used: - LIBERVIA_BRIDGE_PB_CONNECTION_TYPE - LIBERVIA_BRIDGE_PB_HOST - LIBERVIA_BRIDGE_PB_PORT
author Goffi <goffi@goffi.org>
date Sat, 28 Aug 2021 15:26:02 +0200
parents 7550ae9cfbac
children 7bc443253b7c 4a89342476e9
line wrap: on
line diff
--- a/sat/core/sat_main.py	Fri Aug 27 14:59:47 2021 +0200
+++ b/sat/core/sat_main.py	Sat Aug 28 15:26:02 2021 +0200
@@ -85,7 +85,10 @@
             trigger.TriggerManager()
         )
 
-        bridge_name = self.memory.getConfig("", "bridge", "dbus")
+        bridge_name = (
+            os.getenv("LIBERVIA_BRIDGE_NAME")
+            or self.memory.getConfig("", "bridge", "dbus")
+        )
 
         bridge_module = dynamic_import.bridge(bridge_name)
         if bridge_module is None: