Implement horizon_images_allow_location mine function

Exposes glance show_multiple_locations option into horizon

Change-Id: I177de06ebf4069a43a012db6f3956dcb27d7db62
Related-Prod: PROD-21005
diff --git a/README.rst b/README.rst
index f050338..a1478c4 100644
--- a/README.rst
+++ b/README.rst
@@ -466,6 +466,17 @@
             strategy: ENCRYPT
             secret_key: secret
 
+Show all image locations when returning an image. This configuration option indicates
+whether to show all the image locations when returning image details to the user.
+
+.. code-block:: yaml
+
+    glance:
+      server:
+        enabled: true
+        ...
+        show_multiple_locations: True
+
 Usage
 =====
 
diff --git a/glance/server.sls b/glance/server.sls
index 9c2bff3..27ceeb2 100644
--- a/glance/server.sls
+++ b/glance/server.sls
@@ -89,6 +89,19 @@
   - require_in:
     - sls: glance.db.offline_sync
 
+{%- if server.show_multiple_locations is defined %}
+horizon_images_allow_location:
+  module.run:
+    - name: mine.send
+    - func: images_allow_location
+    - kwargs:
+        mine_function: cmd.run
+    - args:
+      - 'echo "{{ server.show_multiple_locations }}"'
+    - require:
+      - file: /etc/glance/glance-api.conf
+{%- endif %}
+
 /etc/glance/glance-api-paste.ini:
   file.managed:
   - source: salt://glance/files/{{ server.version }}/glance-api-paste.ini
diff --git a/tests/pillar/cluster.sls b/tests/pillar/cluster.sls
index b207e46..35d5f62 100644
--- a/tests/pillar/cluster.sls
+++ b/tests/pillar/cluster.sls
@@ -71,3 +71,4 @@
         enabled: true
         strategy: ENCRYPT
         secret_key: secret
+    show_multiple_locations: True