From 21791d1f8929af24196150b70db5864836ac8c83 Mon Sep 17 00:00:00 2001 From: Telles Nobrega Date: Thu, 31 Jan 2019 14:32:32 -0300 Subject: [PATCH] Changing hdfs fs to hdfs dfs The command hdfs fs has been deprecated in favor of hdfs dfs. Story: #2004952 Task: #29368 Change-Id: If8db759ab40ca858594498bc5e6f94f416da2545 --- releasenotes/notes/hdfs-dfs-94a9c4f64cf8994f.yaml | 5 +++++ sahara/service/edp/hdfs_helper.py | 2 +- sahara/tests/unit/service/edp/test_hdfs_helper.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/hdfs-dfs-94a9c4f64cf8994f.yaml diff --git a/releasenotes/notes/hdfs-dfs-94a9c4f64cf8994f.yaml b/releasenotes/notes/hdfs-dfs-94a9c4f64cf8994f.yaml new file mode 100644 index 0000000000..1e14b9e759 --- /dev/null +++ b/releasenotes/notes/hdfs-dfs-94a9c4f64cf8994f.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + The command hdfs fs has been deprecated in favor of hdfs fs. This + fixes will allow the use of Hbase service. diff --git a/sahara/service/edp/hdfs_helper.py b/sahara/service/edp/hdfs_helper.py index b7fe194157..0942fd5ac9 100644 --- a/sahara/service/edp/hdfs_helper.py +++ b/sahara/service/edp/hdfs_helper.py @@ -39,7 +39,7 @@ def create_hbase_common_lib(r): paths = stdout.split(':') for p in paths: if p.endswith(".jar"): - r.execute_command('sudo su - -c "hdfs fs -put -p %s %s" hdfs' + r.execute_command('sudo su - -c "hdfs dfs -put -p %s %s" hdfs' % (p, HBASE_COMMON_LIB_PATH)) else: raise ex.RequiredServiceMissingException('hbase') diff --git a/sahara/tests/unit/service/edp/test_hdfs_helper.py b/sahara/tests/unit/service/edp/test_hdfs_helper.py index bd27c3dc11..6240f4b462 100644 --- a/sahara/tests/unit/service/edp/test_hdfs_helper.py +++ b/sahara/tests/unit/service/edp/test_hdfs_helper.py @@ -40,7 +40,7 @@ class HDFSHelperTestCase(base.SaharaTestCase): mock.call(('sudo su - -c "hdfs dfs -mkdir -p ' '/user/sahara-hbase-lib" hdfs')), mock.call('hbase classpath'), - mock.call(('sudo su - -c "hdfs fs -put -p may.jar ' + mock.call(('sudo su - -c "hdfs dfs -put -p may.jar ' '/user/sahara-hbase-lib" hdfs'))] self.cluster.execute_command.assert_has_calls(calls)