Skip to content

Commit 1846df1

Browse files
committed
net/haproxy: respect order in error messages
1 parent 713771e commit 1846df1

File tree

1 file changed

+18
-18
lines changed
  • net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy

1 file changed

+18
-18
lines changed

net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -450,15 +450,15 @@
450450
{% do action_options.append('use_backend ' ~ acl_backend_data.name) %}
451451
{% else %}
452452
{% set action_enabled = '0' %}
453-
# ERROR: missing parameters
453+
{% do global_action_options.append('# ERROR: missing parameters') %}
454454
{% endif %}
455455
{% elif action_data.type == 'use_server' %}
456456
{% if action_data.use_server|default("") != "" %}
457457
{% set server_data = helpers.getUUID(action_data.use_server) %}
458458
{% do action_options.append('use-server ' ~ server_data.name) %}
459459
{% else %}
460460
{% set action_enabled = '0' %}
461-
# ERROR: missing parameters
461+
{% do global_action_options.append('# ERROR: missing parameters') %}
462462
{% endif %}
463463
{% elif action_data.type == 'map_use_backend' %}
464464
{# # First get the map file path #}
@@ -484,21 +484,21 @@
484484
{% do action_options.append('use_backend %[req.hdr(host),' ~ mapfile_config ~ '(' ~ mapfile_path ~ defaultbackend_option ~ ')]') %}
485485
{% else %}
486486
{% set action_enabled = '0' %}
487-
# ERROR: missing parameters
487+
{% do global_action_options.append('# ERROR: missing parameters') %}
488488
{% endif %}
489489
{% elif action_data.type == 'fcgi_pass_header' %}
490490
{% if action_data.fcgi_pass_header|default('') != '' %}
491491
{% do action_options.append('pass-header ' ~ action_data.fcgi_pass_header) %}
492492
{% else %}
493493
{% set action_enabled = '0' %}
494-
# ERROR: missing parameters
494+
{% do global_action_options.append('# ERROR: missing parameters') %}
495495
{% endif %}
496496
{% elif action_data.type == 'fcgi_set_param' %}
497497
{% if action_data.fcgi_set_param|default('') != '' %}
498498
{% do action_options.append('set-param ' ~ action_data.fcgi_set_param) %}
499499
{% else %}
500500
{% set action_enabled = '0' %}
501-
# ERROR: missing parameters
501+
{% do global_action_options.append('# ERROR: missing parameters') %}
502502
{% endif %}
503503
{% elif action_data.type == 'http-after-response' %}
504504
{% if action_data.http_after_response_action|default('') != '' %}
@@ -508,7 +508,7 @@
508508
{% endif %}
509509
{% else %}
510510
{% set action_enabled = '0' %}
511-
# ERROR: missing parameters
511+
{% do global_action_options.append('# ERROR: missing parameters') %}
512512
{% endif %}
513513
{% elif action_data.type == 'http-request' %}
514514
{% if action_data.http_request_action|default('') != '' %}
@@ -528,7 +528,7 @@
528528
{% do action_options.append('http-request ' ~ action_keyword_data) %}
529529
{% else %}
530530
{% set action_enabled = '0' %}
531-
# ERROR: missing parameters
531+
{% do global_action_options.append('# ERROR: missing parameters') %}
532532
{% endif %}
533533
{% elif action_data.type == 'http-response' %}
534534
{% if action_data.http_response_action|default('') != '' %}
@@ -546,15 +546,15 @@
546546
{% do action_options.append('http-response ' ~ action_keyword_data) %}
547547
{% else %}
548548
{% set action_enabled = '0' %}
549-
# ERROR: missing parameters
549+
{% do global_action_options.append('# ERROR: missing parameters') %}
550550
{% endif %}
551551
{% elif action_data.type == 'monitor_fail' %}
552552
{% if action_data.monitor_fail_uri|default("") != "" %}
553553
{% do action_options.append('monitor-uri ' ~ action_data.monitor_fail_uri ~ '\n ') %}
554554
{% do action_options.append('monitor fail') %}
555555
{% else %}
556556
{% set action_enabled = '0' %}
557-
# ERROR: missing parameters
557+
{% do global_action_options.append('# ERROR: missing parameters') %}
558558
{% endif %}
559559
{% elif action_data.type == 'tcp-request' %}
560560
{% if action_data.tcp_request_action|default('') != '' %}
@@ -574,7 +574,7 @@
574574
{% do action_options.append('tcp-request ' ~ action_keyword_data) %}
575575
{% else %}
576576
{% set action_enabled = '0' %}
577-
# ERROR: missing parameters
577+
{% do global_action_options.append('# ERROR: missing parameters') %}
578578
{% endif %}
579579
{% elif action_data.type == 'tcp-response' %}
580580
{% if action_data.tcp_response_action|default('') != '' %}
@@ -592,7 +592,7 @@
592592
{% do action_options.append('tcp-response ' ~ action_keyword_data) %}
593593
{% else %}
594594
{% set action_enabled = '0' %}
595-
# ERROR: missing parameters
595+
{% do global_action_options.append('# ERROR: missing parameters') %}
596596
{% endif %}
597597
{% elif action_data.type == 'compression' %}
598598
{% set action_multiline = '1' %}
@@ -622,18 +622,18 @@
622622
{% endif %}
623623
{% else %}
624624
{% set action_enabled = '0' %}
625-
# ERROR: missing parameters
625+
{% do global_action_options.append('# ERROR: missing parameters') %}
626626
{% endif %}
627627
{% elif action_data.type == 'custom' %}
628628
{% if action_data.custom|default("") != "" %}
629629
{% do action_options.append(action_data.custom) %}
630630
{% else %}
631631
{% set action_enabled = '0' %}
632-
# ERROR: missing parameters
632+
{% do global_action_options.append('# ERROR: missing parameters') %}
633633
{% endif %}
634634
{% else %}
635635
{% set action_enabled = '0' %}
636-
# ERROR: unsupported rule type
636+
{% do global_action_options.append('# ERROR: unsupported rule type' ~ action_data.type) %}
637637
{% endif %}
638638
{# # Is this rule enabled in the GUI? #}
639639
{% if action_data.enabled|default('') == '1' %}
@@ -664,14 +664,14 @@
664664
{% do global_action_options.append(([action_options|join(join_char), acl_line]|join(' '))) %}
665665
{% endif %}
666666
{% else %}
667-
# RULE INVALID: {{action_data.name}}
667+
{% do global_action_options.append('# RULE INVALID: ' + action_data.name) %}
668668
{% endif %}
669669
{% else %}
670-
# RULE DISABLED: {{action_data.name}}
670+
{% do global_action_options.append('# RULE DISABLED: ' + action_data.name) %}
671671
{% endif %}
672672
{% else %}
673-
# RULE INVALID: {{action_data.name}}
674-
# CONDITIONS WITH ERRORS: {{acl_errors}}
673+
{% do global_action_options.append('# RULE INVALID: ' + action_data.name) %}
674+
{% do global_action_options.append('# CONDITIONS WITH ERRORS: ' + acl_errors) %}
675675
{% endif %}
676676
{% endfor %}
677677

0 commit comments

Comments
 (0)