瀏覽代碼

[jobsub] HTTP 500 trying to install Job Design samples

Python 2.4 syntax
Romain Rigaux 13 年之前
父節點
當前提交
62a37f0c25
共有 1 個文件被更改,包括 10 次插入9 次删除
  1. 10 9
      desktop/libs/hadoop/src/hadoop/fs/webhdfs.py

+ 10 - 9
desktop/libs/hadoop/src/hadoop/fs/webhdfs.py

@@ -423,15 +423,16 @@ class WebHdfs(Hdfs):
     if not self.exists(home_path):
       user = self.user
       try:
-        self.setuser(self.superuser)
-        self.mkdir(home_path)
-        self.chmod(home_path, 0755)
-        self.chown(home_path, user, user)
-      except IOError, e:
-        msg = 'Failed to create home dir ("%s") as superuser %s' %\
-              (home_path, self.superuser)
-        LOG.exception(msg)
-        raise PopupException(msg, detail=e)
+        try:
+          self.setuser(self.superuser)
+          self.mkdir(home_path)
+          self.chmod(home_path, 0755)
+          self.chown(home_path, user, user)
+        except IOError, e:
+          msg = 'Failed to create home dir ("%s") as superuser %s' %\
+                (home_path, self.superuser)
+          LOG.exception(msg)
+          raise PopupException(msg, detail=e)
       finally:
         self.setuser(user)