Merge "Update Gemfile and Makefile configuration - One Gemfile for all formulas tests - Update Makefile for OpenStack tests"
diff --git a/README.rst b/README.rst
index 4f42745..f9ead07 100644
--- a/README.rst
+++ b/README.rst
@@ -564,7 +564,7 @@
Images upload mode:
Horizon allows to use different strategies when uploading images to glance that are
controlled by `horizon:server:images_upload_mode` pillar, possible options are
-direct, ligacy, off. When `direct` mode is used CORS have to be disabled on glance
+direct, ligacy, off. When `direct` mode is used CORS have to be enabled on glance
side, and client should use modern browser.
.. code-block:: yaml
@@ -573,6 +573,19 @@
server:
images_upload_mode: "direct"
+Images allow location:
+If set to True, this setting allows users to specify an image location (URL) as the image source
+when creating or updating images. Depending on the Glance version, the ability to set an image
+location is controlled by policies and/or the Glance configuration. Therefore IMAGES_ALLOW_LOCATION
+should only be set to True if Glance is configured to allow specifying a location.
+
+.. code-block:: yaml
+
+ horizon:
+ server:
+ images_allow_location: True
+
+
Upgrades
========
diff --git a/horizon/files/horizon_settings/_glance_settings.py b/horizon/files/horizon_settings/_glance_settings.py
index 45729ec..9a054f5 100644
--- a/horizon/files/horizon_settings/_glance_settings.py
+++ b/horizon/files/horizon_settings/_glance_settings.py
@@ -35,6 +35,15 @@
"project_id": _("Project ID"),
"image_type": _("Image Type")
}
+{%- if app.images_allow_location is defined %}
+# Pillar data
+IMAGES_ALLOW_LOCATION = {{ app.images_allow_location }}
+{%- elif salt['mine.get']('I@glance:server', 'images_allow_location', 'compound') %}
+# Mine data
+IMAGES_ALLOW_LOCATION = {{ salt['mine.get']('I@glance:server', 'images_allow_location', 'compound').values()[0] }}
+{%- else %}
+# Default
+IMAGES_ALLOW_LOCATION = True
+{%- endif %}
HORIZON_IMAGES_UPLOAD_MODE = {{ app.get('images_upload_mode', 'legacy')|yaml_dquote }}
-IMAGES_ALLOW_LOCATION = True
diff --git a/tests/pillar/cluster.sls b/tests/pillar/cluster.sls
index d6ab61d..b493ab9 100644
--- a/tests/pillar/cluster.sls
+++ b/tests/pillar/cluster.sls
@@ -66,6 +66,8 @@
name: "Material"
description: "Google's Material Design style theme"
path: "themes/material"
+ images_upload_mode: 'direct'
+ images_allow_location: True
haproxy:
proxy: