Disable ovs_parse_bridge script if lb is used

Change-Id: Ied6250cd69ac0e423dc4722360c5d5f3e885a441
Related-bug: PROD-35659
diff --git a/telegraf/meta/telegraf.yml b/telegraf/meta/telegraf.yml
index 036a788..5d473bd 100644
--- a/telegraf/meta/telegraf.yml
+++ b/telegraf/meta/telegraf.yml
@@ -15,20 +15,31 @@
 {%- if pillar.neutron is defined %}
   {%- for component in ['gateway', 'compute'] %}
     {%- set neutron_config = pillar.neutron.get(component, {}) %}
-    {%- if neutron_config.get('enabled', False) == True and 'ovs' in neutron_config.get('backend', {}).get('mechanism', {}).keys() %}
+    {%- if neutron_config.get('enabled', False) == True %}
+      {%- set gateway_enabled = pillar.neutron.get('gateway', {}).get('enabled', False) == True %}
+      {%- set compute_dhcp_enabled = pillar.neutron.get('compute',{}).get('dhcp_agent_enabled', False) == True %}
+      {%- set mechanism_list = neutron_config.get('backend', {}).get('mechanism', {}).keys() %}
+
+      {%- set parse_br_enabled = 'ovs' in mechanism_list and 'lb' not in mechanism_list %}
+      {%- set arping_enabled = 'ovs' in mechanism_list and (gateway_enabled or compute_dhcp_enabled) %}
+
+      {%- if parse_br_enabled or arping_enabled %}
 agent:
   input:
+        {%- if parse_br_enabled %}
     ovs_parse_bridge:
       template: telegraf/files/input/exec.conf
       commands: "/usr/local/bin/ovs_parse_bridge.py"
       interval: 45s
-      {%- if pillar.neutron.get('gateway', {}).get('enabled', False) == True or pillar.neutron.get('compute',{}).get('dhcp_agent_enabled', False) == True %}
-      {%- set prometheus_address = pillar._param.stacklight_monitor_address %}
+        {%- endif %}
+        {%- if arping_enabled %}
+          {%- set prometheus_address = pillar._param.stacklight_monitor_address %}
     ovs_arping_check:
       template: telegraf/files/input/exec.conf
       commands: "/usr/local/bin/check_ovs_arping.py --host {{ prometheus_address }} --port 15010"
       timeout: 30s
       interval: 45s
+        {%- endif %}
       {%- endif %}
     {%- endif %}
   {%- endfor %}