comparison sat_pubsub/backend.py @ 484:70eddf92bf51

backend: fix check of boolean settings with `publish-options`
author Goffi <goffi@goffi.org>
date Fri, 23 Sep 2022 18:06:12 +0200
parents 0e801ae1869f
children cab491b1b563
comparison
equal deleted inserted replaced
483:e814c98ef07a 484:70eddf92bf51
445 deliverPayloads = configuration[const.OPT_DELIVER_PAYLOADS] 445 deliverPayloads = configuration[const.OPT_DELIVER_PAYLOADS]
446 446
447 # we check that publish-options are satisfied 447 # we check that publish-options are satisfied
448 for field, value in options.items(): 448 for field, value in options.items():
449 try: 449 try:
450 current_value = configuration[field] 450 current_value = str(configuration[field]).lower()
451 except KeyError: 451 except KeyError:
452 raise error.ConstraintFailed( 452 raise error.ConstraintFailed(
453 f"publish-options {field!r} doesn't exist in node configuration" 453 f"publish-options {field!r} doesn't exist in node configuration"
454 ) 454 )
455 if current_value != value: 455 if current_value != value: