Change extensions list type

This patch changes type of extensions pillar to dictionary

Change-Id: Ia8b155766daa111973e90bd59aacaec6a3778506
Related-PROD: PROD-14689
diff --git a/.kitchen.yml b/.kitchen.yml
index ba95941..1051363 100644
--- a/.kitchen.yml
+++ b/.kitchen.yml
@@ -93,7 +93,6 @@
       pillars-from-files:
         neutron.sls: tests/pillar/compute_qos.sls
 
-
   - name: control_cluster
     provisioner:
       pillars-from-files:
diff --git a/README.rst b/README.rst
index 4a5787a..3b161e5 100644
--- a/README.rst
+++ b/README.rst
@@ -953,8 +953,14 @@
       server:
         backend:
           extension:
-            - dns
-            - qos
+            dns:
+              enabled: True
+              host: 127.0.0.1
+              port: 9001
+              protocol: http
+              ....
+            qos
+              enabled: True
 
 
 Documentation and Bugs
diff --git a/neutron/files/ocata/ml2_conf.ini b/neutron/files/ocata/ml2_conf.ini
index 5ecafe3..5356db2 100644
--- a/neutron/files/ocata/ml2_conf.ini
+++ b/neutron/files/ocata/ml2_conf.ini
@@ -137,7 +137,12 @@
 # neutron.ml2.extension_drivers namespace. For example: extension_drivers =
 # port_security,qos (list value)
 #extension_drivers =
-{%- set tmp_ext_list = server.backend.get('extension', []) %}
+{# Get server:backend:extension mapping and prepare tmp_ext_list list with extentions where enabled = True #}
+{%- set tmp_ext_list = [] %}
+{%- for ext_name, ext_params in server.backend.get('extension', {}).iteritems() %}
+{%- do tmp_ext_list.append(ext_name) if ext_params.get('enabled', False)  %}
+{%- endfor %}
+{# Below section is for backward compatible when extentions were separated properties without server:backend:extension pillar #}
 {%- do tmp_ext_list.append('port_security') if 'port_security' not in tmp_ext_list %}
 {%- do tmp_ext_list.append('qos') if server.get('qos', 'True') and 'qos' not in tmp_ext_list %}
 extension_drivers={{ tmp_ext_list|join(',') }}
diff --git a/neutron/files/ocata/openvswitch_agent.ini b/neutron/files/ocata/openvswitch_agent.ini
index 654fc76..a8eecc4 100644
--- a/neutron/files/ocata/openvswitch_agent.ini
+++ b/neutron/files/ocata/openvswitch_agent.ini
@@ -195,7 +195,12 @@
 #agent_type = Open vSwitch agent
 
 # Extensions list to use (list value)
-{%- set tmp_ext_list = neutron.backend.get('extension', []) %}
+{# Get neutron:backend:extension mapping and prepare tmp_ext_list list with extentions where enabled = True #}
+{%- set tmp_ext_list = [] %}
+{%- for ext_name, ext_params in neutron.backend.get('extension', {}).iteritems() %}
+{%- do tmp_ext_list.append(ext_name) if ext_params.get('enabled', False)  %}
+{%- endfor %}
+{# Below section is for backward compatible when extentions were separated properties without neutron:backend:extension pillar #}
 {%- do tmp_ext_list.append('qos') if neutron.get('qos', 'True') and 'qos' not in tmp_ext_list %}
 extensions={{ tmp_ext_list|join(',') }}
 
diff --git a/neutron/files/ocata/sriov_agent.ini b/neutron/files/ocata/sriov_agent.ini
index 9ba9c1a..3a2cb1d 100644
--- a/neutron/files/ocata/sriov_agent.ini
+++ b/neutron/files/ocata/sriov_agent.ini
@@ -122,7 +122,12 @@
 #
 
 # Extensions list to use (list value)
-{%- set tmp_ext_list = neutron.backend.get('extension', []) %}
+{# Get neutron:backend:extension mapping and prepare tmp_ext_list list with extentions where enabled = True #}
+{%- set tmp_ext_list = [] %}
+{%- for ext_name, ext_params in neutron.backend.get('extension', {}).iteritems() %}
+{%- do tmp_ext_list.append(ext_name) if ext_params.get('enabled', False)  %}
+{%- endfor %}
+{# Below section is for backward compatible when extentions were separated properties without neutron:backend:extension pillar #}
 {%- do tmp_ext_list.append('qos') if neutron.get('qos', 'True') and 'qos' not in tmp_ext_list %}
 extensions={{ tmp_ext_list|join(',') }}
 
diff --git a/tests/pillar/compute_qos.sls b/tests/pillar/compute_qos.sls
index 2122e00..fdb3beb 100644
--- a/tests/pillar/compute_qos.sls
+++ b/tests/pillar/compute_qos.sls
@@ -7,9 +7,11 @@
       mechanism:
         ovs:
           driver: openvswitch
+      extension:
+        qos:
+          enabled: true
     dvr: false
     enabled: true
-    qos: true
     external_access: false
     local_ip: 10.1.0.105
     message_queue:
@@ -22,4 +24,4 @@
     metadata:
       host: 127.0.0.1
       password: password
-    version: ocata
\ No newline at end of file
+    version: ocata
diff --git a/tests/pillar/control_qos.sls b/tests/pillar/control_qos.sls
index 9bed6b5..e1a8f6f 100644
--- a/tests/pillar/control_qos.sls
+++ b/tests/pillar/control_qos.sls
@@ -7,6 +7,9 @@
         ovs:
           driver: openvswitch
       tenant_network_types: flat,vxlan
+      extension:
+        qos:
+          enabled: true
     bind:
       address: 172.16.10.101
       port: 9696
@@ -26,7 +29,6 @@
     dns_domain: novalocal
     dvr: false
     enabled: true
-    qos: true
     global_physnet_mtu: 1500
     identity:
       engine: keystone
diff --git a/tests/pillar/gateway_qos.sls b/tests/pillar/gateway_qos.sls
index fea882e..f816c94 100644
--- a/tests/pillar/gateway_qos.sls
+++ b/tests/pillar/gateway_qos.sls
@@ -7,9 +7,11 @@
       mechanism:
         ovs:
           driver: openvswitch
+      extension:
+        qos:
+          enabled: true
     dvr: false
     enabled: true
-    qos: true
     external_access: True
     local_ip: 10.1.0.110
     message_queue: