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
This commit is contained in:
Goffi 2021-08-28 15:26:02 +02:00
commit 547eb9feba

View file

@ -85,7 +85,10 @@ class SAT(service.Service):
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: