summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFélix Cantournet <felix.cantournet@cloudwatt.com>2016-04-27 22:17:01 +0200
committerFélix Cantournet <felix.cantournet@cloudwatt.com>2016-06-01 15:35:47 +0200
commit4f053c61d6ea49cf566fd7d3d3b1000f2a7a62b5 (patch)
treef6d5cf4cc4fe36e529616524ac14bca6ed7e5361
parent12022385fb386b972c989310c4227509be4a7ec7 (diff)
downloadswift-4f053c61d6ea49cf566fd7d3d3b1000f2a7a62b5.tar.gz
Fix swift-dispersion in multi-region setups
If you have 2 swift regions served by the same keystone, then the client cannot get the correct URL for the swift endpoint without specifying a region_name. Closes-Bug: 1587088 Change-Id: Iaab883386e125c3ca6b9554389e63df17267a135
-rwxr-xr-xbin/swift-dispersion-populate3
-rwxr-xr-xbin/swift-dispersion-report3
-rw-r--r--etc/dispersion.conf-sample4
3 files changed, 10 insertions, 0 deletions
diff --git a/bin/swift-dispersion-populate b/bin/swift-dispersion-populate
index 465966160..afdc7cd32 100755
--- a/bin/swift-dispersion-populate
+++ b/bin/swift-dispersion-populate
@@ -134,6 +134,7 @@ Usage: %%prog [options] [conf_file]
retries = int(conf.get('retries', 5))
concurrency = int(conf.get('concurrency', 25))
endpoint_type = str(conf.get('endpoint_type', 'publicURL'))
+ region_name = str(conf.get('region_name', ''))
user_domain_name = str(conf.get('user_domain_name', ''))
project_domain_name = str(conf.get('project_domain_name', ''))
project_name = str(conf.get('project_name', ''))
@@ -157,6 +158,8 @@ Usage: %%prog [options] [conf_file]
os_options['project_domain_name'] = project_domain_name
if project_name:
os_options['project_name'] = project_name
+ if region_name:
+ os_options['region_name'] = region_name
url, token = get_auth(conf['auth_url'], conf['auth_user'],
conf['auth_key'],
diff --git a/bin/swift-dispersion-report b/bin/swift-dispersion-report
index 48dff80a8..813156cf5 100755
--- a/bin/swift-dispersion-report
+++ b/bin/swift-dispersion-report
@@ -353,6 +353,7 @@ Usage: %%prog [options] [conf_file]
retries = int(conf.get('retries', 5))
concurrency = int(conf.get('concurrency', 25))
endpoint_type = str(conf.get('endpoint_type', 'publicURL'))
+ region_name = str(conf.get('region_name', ''))
if options.dump_json or config_true_value(conf.get('dump_json', 'no')):
json_output = True
container_report = config_true_value(conf.get('container_report', 'yes')) \
@@ -378,6 +379,8 @@ Usage: %%prog [options] [conf_file]
os_options['project_domain_name'] = project_domain_name
if project_name:
os_options['project_name'] = project_name
+ if region_name:
+ os_options['region_name'] = region_name
url, token = get_auth(conf['auth_url'], conf['auth_user'],
conf['auth_key'],
diff --git a/etc/dispersion.conf-sample b/etc/dispersion.conf-sample
index 865e80fec..eae777a08 100644
--- a/etc/dispersion.conf-sample
+++ b/etc/dispersion.conf-sample
@@ -24,6 +24,10 @@ auth_key = testing
# user_domain_name = user_domain
#
# endpoint_type = publicURL
+#
+# NOTE: If you have only 1 region with a swift endpoint, no need to specify it
+# region_name =
+#
# keystone_api_insecure = no
#
# swift_dir = /etc/swift