Allow to set images upload mode

The behaviour is controlled via horizon:server:images_upload_mode.

Change-Id: Icdd71af50d02e3f55e5f94a90d96cbf32c3816ab
Related-Prod: PROD-24536
diff --git a/README.rst b/README.rst
index bd866d0..4f42745 100644
--- a/README.rst
+++ b/README.rst
@@ -561,6 +561,17 @@
               id: myidp
               protocol: saml2
 
+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
+side, and client should use modern browser.
+
+.. code-block:: yaml
+
+    horizon:
+      server:
+        images_upload_mode: "direct"
 
 Upgrades
 ========
diff --git a/horizon/files/horizon_settings/_glance_settings.py b/horizon/files/horizon_settings/_glance_settings.py
index cc3fc85..45729ec 100644
--- a/horizon/files/horizon_settings/_glance_settings.py
+++ b/horizon/files/horizon_settings/_glance_settings.py
@@ -36,5 +36,5 @@
     "image_type": _("Image Type")
 }
 
-HORIZON_IMAGES_UPLOAD_MODE = "legacy"
+HORIZON_IMAGES_UPLOAD_MODE = {{ app.get('images_upload_mode', 'legacy')|yaml_dquote }}
 IMAGES_ALLOW_LOCATION = True