Browse Source

Fix file upload in the tests. Make sure settings from the system hadoop
conf dir aren't picked up.

Aaron T. Myers 15 years ago
parent
commit
f73c2eaaac

+ 3 - 0
desktop/libs/hadoop/src/hadoop/fs/hadoopfs.py

@@ -808,6 +808,9 @@ class FileUpload(object):
     else:
     else:
       self.subprocess_env['HADOOP_CLASSPATH'] = hadoop.conf.HADOOP_STATIC_GROUP_MAPPING_CLASSPATH.get()
       self.subprocess_env['HADOOP_CLASSPATH'] = hadoop.conf.HADOOP_STATIC_GROUP_MAPPING_CLASSPATH.get()
 
 
+    if hadoop.conf.HADOOP_CONF_DIR.get():
+      self.subprocess_env['HADOOP_CONF_DIR'] = hadoop.conf.HADOOP_CONF_DIR.get()
+
     self.path = path
     self.path = path
     self.putter = subprocess.Popen(self.subprocess_cmd,
     self.putter = subprocess.Popen(self.subprocess_cmd,
                                    stdin=subprocess.PIPE,
                                    stdin=subprocess.PIPE,

+ 4 - 0
desktop/libs/hadoop/src/hadoop/mini_cluster.py

@@ -188,6 +188,7 @@ rpc.class=org.apache.hadoop.metrics.spi.NoEmitMetricsContext
       env["HADOOP_HEAPSIZE"] = "128"
       env["HADOOP_HEAPSIZE"] = "128"
       env["HADOOP_HOME"] = hadoop.conf.HADOOP_HOME.get()
       env["HADOOP_HOME"] = hadoop.conf.HADOOP_HOME.get()
       env["HADOOP_LOG_DIR"] = self.log_dir
       env["HADOOP_LOG_DIR"] = self.log_dir
+      env["USER"] = self.superuser
       if "JAVA_HOME" in os.environ:
       if "JAVA_HOME" in os.environ:
         env["JAVA_HOME"] = os.environ["JAVA_HOME"]
         env["JAVA_HOME"] = os.environ["JAVA_HOME"]
       # Wait for the debugger to attach
       # Wait for the debugger to attach
@@ -240,6 +241,9 @@ rpc.class=org.apache.hadoop.metrics.spi.NoEmitMetricsContext
     # which can, in turn, be used for /bin/hadoop.
     # which can, in turn, be used for /bin/hadoop.
     self.config_dir = tmppath("conf")
     self.config_dir = tmppath("conf")
     os.mkdir(self.config_dir)
     os.mkdir(self.config_dir)
+
+    hadoop.conf.HADOOP_CONF_DIR.set_for_testing(self.config_dir)
+
     write_config(self.config, tmppath("conf/core-site.xml"), 
     write_config(self.config, tmppath("conf/core-site.xml"), 
       ["fs.default.name", "jobclient.completion.poll.interval",
       ["fs.default.name", "jobclient.completion.poll.interval",
        "fs.checkpoint.period", "fs.checkpoint.dir",
        "fs.checkpoint.period", "fs.checkpoint.dir",