Merge pull request #343 from mlk/hdfs-rm-rm_X_Is_a_directory_add_minus_r

hdfs -rm -r /directory and hdfs -mkdir -p /directory/sub support
This commit is contained in:
Vladimir Iakovlev
2015-08-21 18:34:19 +03:00
4 changed files with 36 additions and 14 deletions
+1 -1
View File
@@ -10,4 +10,4 @@ def match(command, settings):
@sudo_support
def get_new_command(command, settings):
return re.sub('^mkdir (.*)', 'mkdir -p \\1', command.script)
return re.sub('\\bmkdir (.*)', 'mkdir -p \\1', command.script)
+4 -1
View File
@@ -10,4 +10,7 @@ def match(command, settings):
@sudo_support
def get_new_command(command, settings):
return re.sub('^rm (.*)', 'rm -rf \\1', command.script)
arguments = '-rf'
if 'hdfs' in command.script:
arguments = '-r'
return re.sub('\\brm (.*)', 'rm ' + arguments + ' \\1', command.script)