comparison 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
comparison
equal deleted inserted replaced
3632:7acf19bdca2f 3634:3c7a64d6f49f
83 # trigger are used to change SàT behaviour 83 # trigger are used to change SàT behaviour
84 self.trigger = ( 84 self.trigger = (
85 trigger.TriggerManager() 85 trigger.TriggerManager()
86 ) 86 )
87 87
88 bridge_name = self.memory.getConfig("", "bridge", "dbus") 88 bridge_name = (
89 os.getenv("LIBERVIA_BRIDGE_NAME")
90 or self.memory.getConfig("", "bridge", "dbus")
91 )
89 92
90 bridge_module = dynamic_import.bridge(bridge_name) 93 bridge_module = dynamic_import.bridge(bridge_name)
91 if bridge_module is None: 94 if bridge_module is None:
92 log.error("Can't find bridge module of name {}".format(bridge_name)) 95 log.error("Can't find bridge module of name {}".format(bridge_name))
93 sys.exit(1) 96 sys.exit(1)