From 391bfbad64f3bd76ab019607e399ec77bdcf5a8c Mon Sep 17 00:00:00 2001 From: Jeremy Freudberg Date: Mon, 4 Jun 2018 16:37:38 -0400 Subject: [PATCH] Better default value for domain in swift config The default value of domain id as 'default' set in the Java code is not always ideal. This is not totally ideal either (see the comments) but helps somewhat. Change-Id: Ib5433ee441fb4d63f76e43e0c449e97d197a5b18 --- .../hadoop-swift-domain-fix-c1dfdf6c52b5aa25.yaml | 5 +++++ sahara/swift/swift_helper.py | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 releasenotes/notes/hadoop-swift-domain-fix-c1dfdf6c52b5aa25.yaml diff --git a/releasenotes/notes/hadoop-swift-domain-fix-c1dfdf6c52b5aa25.yaml b/releasenotes/notes/hadoop-swift-domain-fix-c1dfdf6c52b5aa25.yaml new file mode 100644 index 0000000000..f38a252e7c --- /dev/null +++ b/releasenotes/notes/hadoop-swift-domain-fix-c1dfdf6c52b5aa25.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - Hadoop is now better configured to use the proper Keystone domain + for interaction with Swift; previously the 'default' domain may + have been incorrectly used. diff --git a/sahara/swift/swift_helper.py b/sahara/swift/swift_helper.py index 947859bd88..25296e6b2a 100644 --- a/sahara/swift/swift_helper.py +++ b/sahara/swift/swift_helper.py @@ -60,6 +60,16 @@ def get_swift_configs(): conf['value'] = retrieve_tenant() if CONF.os_region_name and conf['name'] == HADOOP_SWIFT_REGION: conf['value'] = CONF.os_region_name + if conf['name'] == HADOOP_SWIFT_DOMAIN_NAME: + # NOTE(jfreud): Don't be deceived here... Even though there is an + # attribute provided by context called domain_name, it is used for + # domain scope, and hadoop-swiftfs always authenticates using + # project scope. The purpose of the setting below is to override + # the default value for project domain and user domain, domain id + # as 'default', which may not always be correct. + # TODO(jfreud): When hadoop-swiftfs allows it, stop hoping that + # project_domain_name is always equal to user_domain_name. + conf['value'] = context.current().project_domain_name result = [cfg for cfg in configs if cfg['value']] LOG.info("Swift would be integrated with the following "