Repository: ambari Updated Branches: refs/heads/trunk 1ecc41996 -> 4ca2ba7a3
AMBARI-11645. Unable to communicate to Namenode after wire encryption (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4ca2ba7a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4ca2ba7a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4ca2ba7a Branch: refs/heads/trunk Commit: 4ca2ba7a333f82ab289f1089a57c62789477c606 Parents: 1ecc419 Author: Andrew Onishuk <[email protected]> Authored: Wed Jun 3 13:40:03 2015 +0300 Committer: Andrew Onishuk <[email protected]> Committed: Wed Jun 3 13:40:03 2015 +0300 ---------------------------------------------------------------------- .../resource_management/libraries/providers/hdfs_resource.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/4ca2ba7a/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py b/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py index 33d356f..4b1c27c 100644 --- a/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py +++ b/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py @@ -122,10 +122,10 @@ class WebHDFSUtil: def __init__(self, hdfs_site, run_user, security_enabled, logoutput=None): https_nn_address = namenode_ha_utils.get_property_for_active_namenode(hdfs_site, 'dfs.namenode.https-address') http_nn_address = namenode_ha_utils.get_property_for_active_namenode(hdfs_site, 'dfs.namenode.http-address') - is_https_enabled = hdfs_site['dfs.https.enabled'] if not is_empty(hdfs_site['dfs.https.enabled']) else False + self.is_https_enabled = hdfs_site['dfs.https.enable'] if not is_empty(hdfs_site['dfs.https.enable']) else False - address = https_nn_address if is_https_enabled else http_nn_address - protocol = "https" if is_https_enabled else "http" + address = https_nn_address if self.is_https_enabled else http_nn_address + protocol = "https" if self.is_https_enabled else "http" self.address = format("{protocol}://{address}") self.run_user = run_user @@ -177,6 +177,8 @@ class WebHDFSUtil: cmd += ["-T", file_to_put] if self.security_enabled: cmd += ["--negotiate", "-u", ":"] + if self.is_https_enabled: + cmd += ["-k"] cmd.append(url) _, out = shell.checked_call(cmd, user=self.run_user, logoutput=self.logoutput, quiet=False)
