0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-14 17:44:01 +01:00

Blow up config if opentracing is missing (#5985)

* Blow up config if opentracing is missing
This commit is contained in:
Jorik Schellekens 2019-09-12 10:57:37 +01:00 committed by GitHub
parent f1b40694ea
commit a8251da10f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

1
changelog.d/5985.feature Normal file
View file

@ -0,0 +1 @@
Check at setup that opentracing is installed if it's enabled in the config.

View file

@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from synapse.python_dependencies import DependencyException, check_requirements
from ._base import Config, ConfigError from ._base import Config, ConfigError
@ -32,6 +34,11 @@ class TracerConfig(Config):
if not self.opentracer_enabled: if not self.opentracer_enabled:
return return
try:
check_requirements("opentracing")
except DependencyException as e:
raise ConfigError(e.message)
# The tracer is enabled so sanitize the config # The tracer is enabled so sanitize the config
self.opentracer_whitelist = opentracing_config.get("homeserver_whitelist", []) self.opentracer_whitelist = opentracing_config.get("homeserver_whitelist", [])