From 587ef85c7f3e3da93c00bf3210be42522b0fe8a9 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Wed, 2 Sep 2015 17:37:46 -0400 Subject: [PATCH] Allow users to choose the version of Swift to use Fixes #442 --- static/directives/config/config-setup-tool.html | 6 ++++++ static/js/core-config-setup.js | 1 + storage/swift.py | 6 +++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/static/directives/config/config-setup-tool.html b/static/directives/config/config-setup-tool.html index 43bff96f3..ae85f6d48 100644 --- a/static/directives/config/config-setup-tool.html +++ b/static/directives/config/config-setup-tool.html @@ -226,6 +226,12 @@ ng-model="config.DISTRIBUTED_STORAGE_CONFIG.local[1][field.name]"> +
+ +
See Documentation for more information
diff --git a/static/js/core-config-setup.js b/static/js/core-config-setup.js index 7d22d9fed..8e3e2521a 100644 --- a/static/js/core-config-setup.js +++ b/static/js/core-config-setup.js @@ -89,6 +89,7 @@ angular.module("core-config-setup", ['angularFileUpload']) ], 'SwiftStorage': [ + {'name': 'auth_version', 'title': 'Swift Version', 'kind': 'option', 'values': [1, 2]}, {'name': 'auth_url', 'title': 'Swift Auth URL', 'placeholder': '', 'kind': 'text'}, {'name': 'swift_container', 'title': 'Swift Container Name', 'placeholder': 'mycontainer', 'kind': 'text'}, {'name': 'storage_path', 'title': 'Storage Path', 'placeholder': '/path/inside/container', 'kind': 'text'}, diff --git a/storage/swift.py b/storage/swift.py index 73f743290..42023c3c0 100644 --- a/storage/swift.py +++ b/storage/swift.py @@ -22,7 +22,11 @@ class SwiftStorage(BaseStorage): self._swift_user = swift_user self._swift_password = swift_password - self._auth_version = auth_version or 2 + try: + self._auth_version = int(auth_version or '2') + except ValueError: + self._auth_version = 2 + self._os_options = os_options or {} self._initialized = False