You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ni...@apache.org on 2008/06/21 02:32:21 UTC

svn commit: r670102 - in /hadoop/core/branches/branch-0.18/src/contrib/hod: CHANGES.txt hodlib/Hod/hod.py

Author: nigel
Date: Fri Jun 20 17:32:21 2008
New Revision: 670102

URL: http://svn.apache.org/viewvc?rev=670102&view=rev
Log:
HADOOP-3610. Modified HOD to create cluster directory if one does not exist when using the script option. Contributed by Vinod Kumar Vavilapalli

Modified:
    hadoop/core/branches/branch-0.18/src/contrib/hod/CHANGES.txt
    hadoop/core/branches/branch-0.18/src/contrib/hod/hodlib/Hod/hod.py

Modified: hadoop/core/branches/branch-0.18/src/contrib/hod/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/contrib/hod/CHANGES.txt?rev=670102&r1=670101&r2=670102&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/contrib/hod/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.18/src/contrib/hod/CHANGES.txt Fri Jun 20 17:32:21 2008
@@ -11,6 +11,8 @@
     HADOOP-3184. Modified HOD to handle master failures on bad nodes by trying 
     to bring them up on another node in the ring. (Hemanth Yamijala via ddas)
 
+    HADOOP-3610. Modified HOD to create cluster directory if one does not
+    exist when using the script option. (Vinod Kumar Vavilapalli via yhemanth)
 
   NEW FEATURES
 

Modified: hadoop/core/branches/branch-0.18/src/contrib/hod/hodlib/Hod/hod.py
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/contrib/hod/hodlib/Hod/hod.py?rev=670102&r1=670101&r2=670102&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/contrib/hod/hodlib/Hod/hod.py (original)
+++ hadoop/core/branches/branch-0.18/src/contrib/hod/hodlib/Hod/hod.py Fri Jun 20 17:32:21 2008
@@ -608,10 +608,11 @@
                          script + " : Not an executable.")
 
     if not os.path.exists(clusterDir):
-      errorFlag = True
-      errorMsgs.append( \
-                  "Invalid cluster directory (--hod.clusterdir or -d) : " + \
-                  clusterDir + " : No such directory")
+      try:
+        os.makedirs(clusterDir)
+      except OSError, err:
+        errorFlag = True
+        errorMsgs.append("Could not create cluster directory. %s" % (str(err)))
     elif not os.path.isdir(clusterDir):
       errorFlag = True
       errorMsgs.append( \