Merge "Update neutron OVS dashboard with fluentd metrics"
diff --git a/.kitchen.yml b/.kitchen.yml
index da050d9..bdbd54e 100644
--- a/.kitchen.yml
+++ b/.kitchen.yml
@@ -8,7 +8,7 @@
   name: salt_solo
   salt_install: bootstrap
   salt_bootstrap_url: https://bootstrap.saltstack.com
-  salt_version: latest
+  salt_version: <%=ENV['SALT_VERSION'] || 'latest'%>
   require_chef: false
   log_level: error
   formula: neutron
diff --git a/.travis.yml b/.travis.yml
index ee25926..f045b94 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,6 +17,44 @@
   - bundle install
 
 env:
+    - PLATFORM=trevorj/salty-whales:trusty-2017.7 SUITE=compute-dpdk
+    - PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=compute-dpdk
+    - PLATFORM=trevorj/salty-whales:trusty-2017.7 SUITE=compute-dvr
+    - PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=compute-dvr
+    - PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=compute-dvr-fwaas-v1
+    - PLATFORM=trevorj/salty-whales:trusty-2017.7 SUITE=compute-legacy
+    - PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=compute-legacy
+    - PLATFORM=trevorj/salty-whales:trusty-2017.7 SUITE=compute-nonexternal-dvr
+    - PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=compute-nonexternal-dvr
+    - PLATFORM=trevorj/salty-whales:trusty-2017.7 SUITE=compute-sriov
+    - PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=compute-sriov
+    - PLATFORM=trevorj/salty-whales:trusty-2017.7 SUITE=compute-qos-sriov
+    - PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=compute-qos-sriov
+    - PLATFORM=trevorj/salty-whales:trusty-2017.7 SUITE=compute-qos
+    - PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=compute-qos
+    - PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=compute-ovn
+    - PLATFORM=trevorj/salty-whales:trusty-2017.7 SUITE=control-cluster
+    - PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=control-cluster
+    - PLATFORM=trevorj/salty-whales:trusty-2017.7 SUITE=control-dvr
+    - PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=control-dvr
+    - PLATFORM=trevorj/salty-whales:trusty-2017.7 SUITE=control-nodvr
+    - PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=control-nodvr
+    - PLATFORM=trevorj/salty-whales:trusty-2017.7 SUITE=control-single
+    - PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=control-single
+    - PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=control-lbaas-octavia
+    - PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=control-fwaas-v1
+    - PLATFORM=trevorj/salty-whales:trusty-2017.7 SUITE=control-qos
+    - PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=control-qos
+    - PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=control-ovn
+    - PLATFORM=trevorj/salty-whales:trusty-2017.7 SUITE=control-dns
+    - PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=control-dns
+    - PLATFORM=trevorj/salty-whales:trusty-2017.7 SUITE=gateway-dvr
+    - PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=gateway-dvr
+    - PLATFORM=trevorj/salty-whales:trusty-2017.7 SUITE=gateway-legacy
+    - PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=gateway-legacy
+    - PLATFORM=trevorj/salty-whales:trusty-2017.7 SUITE=gateway-qos
+    - PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=gateway-qos
+    - PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=gateway-legacy-fwaas-v1
     - PLATFORM=trevorj/salty-whales:trusty SUITE=compute-dpdk
     - PLATFORM=trevorj/salty-whales:xenial SUITE=compute-dpdk
     - PLATFORM=trevorj/salty-whales:trusty SUITE=compute-dvr
@@ -55,7 +93,6 @@
     - PLATFORM=trevorj/salty-whales:trusty SUITE=gateway-qos
     - PLATFORM=trevorj/salty-whales:xenial SUITE=gateway-qos
     - PLATFORM=trevorj/salty-whales:xenial SUITE=gateway-legacy-fwaas-v1
-
 before_script:
   - set -o pipefail
   - make test | tail
diff --git a/README.rst b/README.rst
index 9e37b32..215d855 100644
--- a/README.rst
+++ b/README.rst
@@ -292,6 +292,35 @@
         external_access: false
 
 
+Add additional bridge mappings for OVS bridges
+----------------------------------------------
+
+By default we have external access turned on, so among any physnets in
+your reclass there would be additional one: physnet1, which is mapped to
+br-floating
+
+If you need to add extra non-default bridge mappings they can be defined
+separately for both gateways and compute nodes:
+
+gateways:
+
+.. code-block:: yaml
+
+    neutron:
+      gateway:
+        bridge_mappings:
+          physnet4: br-floating-internet
+
+compute nodes:
+
+.. code-block:: yaml
+
+    neutron:
+      compute:
+        bridge_mappings:
+          physnet4: br-floating-internet
+
+
 Specify different mtu values for different physnets
 ---------------------------------------------------
 
diff --git a/neutron/files/mitaka/openvswitch_agent.ini b/neutron/files/mitaka/openvswitch_agent.ini
index 25ecbbd..50ba830 100644
--- a/neutron/files/mitaka/openvswitch_agent.ini
+++ b/neutron/files/mitaka/openvswitch_agent.ini
@@ -190,9 +190,15 @@
 # bridges on each agent. Note: If you remove a bridge from this mapping, make sure to disconnect it from the integration bridge as it won't
 # be managed by the agent anymore. Deprecated for ofagent. (list value)
 {% set bridge_mappings=[] %}
-{%- if neutron.get('external_access', True) %}{% do bridge_mappings.append('physnet1:br-floating') %}{%- endif %}
-{%- if "vlan" in neutron.backend.tenant_network_types %}{% do bridge_mappings.append('physnet2:br-prv') %}{%- endif %}
-{%- if neutron.get('ironic_enabled', False) %}{% do bridge_mappings.append('physnet3:br-baremetal') %}{%- endif %}
+{%- if neutron.bridge_mappings is defined %}
+{%- for physnet,bridge in neutron.bridge_mappings.iteritems() %}{%- do bridge_mappings.append(physnet+':'+bridge) %}{%- endfor %}
+{%- endif %}
+{%- if 'br-floating' not in neutron.get('bridge_mappings', {}).values() %}{%- if neutron.get('external_access', True) %}
+{%- do bridge_mappings.append('physnet1:br-floating') %}{%- endif %}{%- endif %}
+{%- if 'br-prv' not in neutron.get('bridge_mappings', {}).values() %}{%- if "vlan" in neutron.backend.tenant_network_types %}
+{%- do bridge_mappings.append('physnet2:br-prv') %}{%- endif %}{%- endif %}
+{%- if 'br-baremetal' not in neutron.get('bridge_mappings', {}).values() %}{%- if neutron.get('ironic_enabled', False) %}
+{%- do bridge_mappings.append('physnet3:br-baremetal') %}{%- endif %}{%- endif %}
 {%- if bridge_mappings %}
 bridge_mappings = {{ ','.join(bridge_mappings) }}
 {%- else %}
diff --git a/neutron/files/newton/openvswitch_agent.ini b/neutron/files/newton/openvswitch_agent.ini
index 25ecbbd..50ba830 100644
--- a/neutron/files/newton/openvswitch_agent.ini
+++ b/neutron/files/newton/openvswitch_agent.ini
@@ -190,9 +190,15 @@
 # bridges on each agent. Note: If you remove a bridge from this mapping, make sure to disconnect it from the integration bridge as it won't
 # be managed by the agent anymore. Deprecated for ofagent. (list value)
 {% set bridge_mappings=[] %}
-{%- if neutron.get('external_access', True) %}{% do bridge_mappings.append('physnet1:br-floating') %}{%- endif %}
-{%- if "vlan" in neutron.backend.tenant_network_types %}{% do bridge_mappings.append('physnet2:br-prv') %}{%- endif %}
-{%- if neutron.get('ironic_enabled', False) %}{% do bridge_mappings.append('physnet3:br-baremetal') %}{%- endif %}
+{%- if neutron.bridge_mappings is defined %}
+{%- for physnet,bridge in neutron.bridge_mappings.iteritems() %}{%- do bridge_mappings.append(physnet+':'+bridge) %}{%- endfor %}
+{%- endif %}
+{%- if 'br-floating' not in neutron.get('bridge_mappings', {}).values() %}{%- if neutron.get('external_access', True) %}
+{%- do bridge_mappings.append('physnet1:br-floating') %}{%- endif %}{%- endif %}
+{%- if 'br-prv' not in neutron.get('bridge_mappings', {}).values() %}{%- if "vlan" in neutron.backend.tenant_network_types %}
+{%- do bridge_mappings.append('physnet2:br-prv') %}{%- endif %}{%- endif %}
+{%- if 'br-baremetal' not in neutron.get('bridge_mappings', {}).values() %}{%- if neutron.get('ironic_enabled', False) %}
+{%- do bridge_mappings.append('physnet3:br-baremetal') %}{%- endif %}{%- endif %}
 {%- if bridge_mappings %}
 bridge_mappings = {{ ','.join(bridge_mappings) }}
 {%- else %}
diff --git a/neutron/files/ocata/openvswitch_agent.ini b/neutron/files/ocata/openvswitch_agent.ini
index a8ae0d2..fa94c21 100644
--- a/neutron/files/ocata/openvswitch_agent.ini
+++ b/neutron/files/ocata/openvswitch_agent.ini
@@ -247,9 +247,15 @@
 # bridge from this mapping, make sure to disconnect it from the integration
 # bridge as it won't be managed by the agent anymore. (list value)
 {% set bridge_mappings=[] %}
-{%- if neutron.get('external_access', True) %}{% do bridge_mappings.append('physnet1:br-floating') %}{%- endif %}
-{%- if "vlan" in neutron.backend.tenant_network_types %}{% do bridge_mappings.append('physnet2:br-prv') %}{%- endif %}
-{%- if neutron.get('ironic_enabled', False) %}{% do bridge_mappings.append('physnet3:br-baremetal') %}{%- endif %}
+{%- if neutron.bridge_mappings is defined %}
+{%- for physnet,bridge in neutron.bridge_mappings.iteritems() %}{%- do bridge_mappings.append(physnet+':'+bridge) %}{%- endfor %}
+{%- endif %}
+{%- if 'br-floating' not in neutron.get('bridge_mappings', {}).values() %}{%- if neutron.get('external_access', True) %}
+{%- do bridge_mappings.append('physnet1:br-floating') %}{%- endif %}{%- endif %}
+{%- if 'br-prv' not in neutron.get('bridge_mappings', {}).values() %}{%- if "vlan" in neutron.backend.tenant_network_types %}
+{%- do bridge_mappings.append('physnet2:br-prv') %}{%- endif %}{%- endif %}
+{%- if 'br-baremetal' not in neutron.get('bridge_mappings', {}).values() %}{%- if neutron.get('ironic_enabled', False) %}
+{%- do bridge_mappings.append('physnet3:br-baremetal') %}{%- endif %}{%- endif %}
 {%- if bridge_mappings %}
 bridge_mappings = {{ ','.join(bridge_mappings) }}
 {%- else %}
diff --git a/neutron/files/pike/openvswitch_agent.ini b/neutron/files/pike/openvswitch_agent.ini
index a8ae0d2..fa94c21 100644
--- a/neutron/files/pike/openvswitch_agent.ini
+++ b/neutron/files/pike/openvswitch_agent.ini
@@ -247,9 +247,15 @@
 # bridge from this mapping, make sure to disconnect it from the integration
 # bridge as it won't be managed by the agent anymore. (list value)
 {% set bridge_mappings=[] %}
-{%- if neutron.get('external_access', True) %}{% do bridge_mappings.append('physnet1:br-floating') %}{%- endif %}
-{%- if "vlan" in neutron.backend.tenant_network_types %}{% do bridge_mappings.append('physnet2:br-prv') %}{%- endif %}
-{%- if neutron.get('ironic_enabled', False) %}{% do bridge_mappings.append('physnet3:br-baremetal') %}{%- endif %}
+{%- if neutron.bridge_mappings is defined %}
+{%- for physnet,bridge in neutron.bridge_mappings.iteritems() %}{%- do bridge_mappings.append(physnet+':'+bridge) %}{%- endfor %}
+{%- endif %}
+{%- if 'br-floating' not in neutron.get('bridge_mappings', {}).values() %}{%- if neutron.get('external_access', True) %}
+{%- do bridge_mappings.append('physnet1:br-floating') %}{%- endif %}{%- endif %}
+{%- if 'br-prv' not in neutron.get('bridge_mappings', {}).values() %}{%- if "vlan" in neutron.backend.tenant_network_types %}
+{%- do bridge_mappings.append('physnet2:br-prv') %}{%- endif %}{%- endif %}
+{%- if 'br-baremetal' not in neutron.get('bridge_mappings', {}).values() %}{%- if neutron.get('ironic_enabled', False) %}
+{%- do bridge_mappings.append('physnet3:br-baremetal') %}{%- endif %}{%- endif %}
 {%- if bridge_mappings %}
 bridge_mappings = {{ ','.join(bridge_mappings) }}
 {%- else %}
diff --git a/neutron/meta/sphinx.yml b/neutron/meta/sphinx.yml
index 20af434..f655e76 100644
--- a/neutron/meta/sphinx.yml
+++ b/neutron/meta/sphinx.yml
@@ -36,6 +36,6 @@
           value: |
             {%- for pkg in server.pkgs %}
             {%- set pkg_version = "dpkg -l "+pkg+" | grep "+pkg+" | awk '{print $3}'" %}
-            * {{ pkg }}: {{ salt['cmd.run'](pkg_version) }}
+            * {{ pkg }}: {{ salt['cmd.shell'](pkg_version) }}
             {%- endfor %}
   {%- endif %}