From eca47ff5214ffe1252d6be7a403bacc4d3b05526 Mon Sep 17 00:00:00 2001 From: Andy Jackson Date: Fri, 21 Jul 2017 21:23:54 +0100 Subject: [PATCH] hadoop: Fix CDH3 mkdir implementation (#2188) --- luigi/contrib/hdfs/hadoopcli_clients.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/luigi/contrib/hdfs/hadoopcli_clients.py b/luigi/contrib/hdfs/hadoopcli_clients.py index e3c57b7c83..e70622eafb 100644 --- a/luigi/contrib/hdfs/hadoopcli_clients.py +++ b/luigi/contrib/hdfs/hadoopcli_clients.py @@ -230,7 +230,8 @@ def mkdir(self, path, parents=True, raise_if_exists=False): self.call_check(load_hadoop_cmd() + ['fs', '-mkdir', path]) except hdfs_error.HDFSCliError as ex: if "File exists" in ex.stderr: - raise FileAlreadyExists(ex.stderr) + if raise_if_exists: + raise FileAlreadyExists(ex.stderr) else: raise