Null value handling, discovered in production logs (#16323)

This commit is contained in:
Alan Rominger
2026-03-04 14:48:21 -05:00
committed by GitHub
parent 143d4cee34
commit 3fbc71e6c8
2 changed files with 5 additions and 3 deletions

View File

@@ -393,9 +393,9 @@ def evaluate_policy(instance):
raise PolicyEvaluationError(_('Following certificate settings are missing for OPA_AUTH_TYPE=Certificate: {}').format(cert_settings_missing))
query_paths = [
('Organization', instance.organization.opa_query_path),
('Inventory', instance.inventory.opa_query_path),
('Job template', instance.job_template.opa_query_path),
('Organization', instance.organization.opa_query_path if instance.organization else None),
('Inventory', instance.inventory.opa_query_path if instance.inventory else None),
('Job template', instance.job_template.opa_query_path if instance.job_template else None),
]
violations = dict()
errors = dict()

View File

@@ -55,6 +55,8 @@ def construct_rsyslog_conf_template(settings=settings):
)
def escape_quotes(x):
if x is None:
return ''
return x.replace('"', '\\"')
if not enabled: