Isilon / isilon_hadoop_tools

Tools for Using Hadoop with OneFS
https://pypi.org/project/isilon-hadoop-tools/
MIT License
14 stars 21 forks source link

Do not raise exception when path already exists #82

Closed shirleylxie closed 4 years ago

shirleylxie commented 4 years ago

Isi sdk will report error when the path to create already exists. This change is to cache the error and not raise an exception.

Test Done:

Dir exists: root@DTRDUCLI587384:~/isilon_hadoop_tools [master *] # venv/bin/isilon_create_directories --zone system --dist hdp --no-verify --onefs-password a 10.224.15.38 [WARNING] Deploying in the System zone is not recommended. [INFO] mkdir '/ifs/hdfs_root/' [WARNING] /ifs/hdfs_root/ already exists. [INFO] chmod '755' '/ifs/hdfs_root/' [INFO] chown 'hdfs:hadoop' '/ifs/hdfs_root/' [INFO] mkdir '/ifs/hdfs_root/app-logs' [WARNING] /ifs/hdfs_root/app-logs already exists.

Dir does not exist: root@DTRDUCLI587384:~/isilon_hadoop_tools [master *] # venv/bin/isilon_create_directories --zone system --dist hdp --no-verify --onefs-password a 10.224.15.38 [WARNING] Deploying in the System zone is not recommended. [INFO] mkdir '/ifs/hdfs_root/' [INFO] chmod '755' '/ifs/hdfs_root/' [INFO] chown 'hdfs:hadoop' '/ifs/hdfs_root/' [INFO] mkdir '/ifs/hdfs_root/app-logs' [INFO] chmod '1777' '/ifs/hdfs_root/app-logs' [INFO] chown 'yarn:hadoop' '/ifs/hdfs_root/app-logs' [INFO] mkdir '/ifs/hdfs_root/app-logs/ambari-qa' [INFO] chmod '770' '/ifs/hdfs_root/app-logs/ambari-qa'

Tox: ======================================================== 45 passed, 86 skipped in 6.01 seconds ======================================================== summary py27-urllib3121: commands succeeded py27-urllib3default: commands succeeded py35-urllib3121: commands succeeded py35-urllib3default: commands succeeded py36-urllib3121: commands succeeded py36-urllib3default: commands succeeded congratulations :) root@DTRDUCLI587384:~/isilon_hadoop_tools [master *]

shirleylxie commented 4 years ago

Updated according to comments.