Add working directory option
refs: #3266
Change-Id: Ifd953b242c99f75c68eb3c63ef5e51ef46195b8b
diff --git a/ndn/nfd.py b/ndn/nfd.py
index a56115b..36dcf96 100644
--- a/ndn/nfd.py
+++ b/ndn/nfd.py
@@ -33,15 +33,10 @@
self.logLevel = node.params["params"].get("nfd-log-level", "NONE")
- # Create home directory for a node
- node.cmd("cd /tmp && mkdir %s" % node.name)
- node.cmd("cd %s" % node.name)
-
- self.homeFolder = "/tmp/%s" % node.name
- self.confFile = "%s/%s.conf" % (self.homeFolder, node.name)
- self.logFile = "%s/%s.log" % (self.homeFolder, node.name)
+ self.confFile = "%s/%s.conf" % (node.homeFolder, node.name)
+ self.logFile = "%s/%s.log" % (node.homeFolder, node.name)
self.sockFile = "/var/run/%s.sock" % node.name
- self.ndnFolder = "%s/.ndn" % self.homeFolder
+ self.ndnFolder = "%s/.ndn" % node.homeFolder
self.clientConf = "%s/client.conf" % self.ndnFolder
# Copy nfd.conf file from /usr/local/etc/mini-ndn to the node's home
@@ -61,7 +56,7 @@
node.cmd("sudo sed -i 's|nfd.sock|%s.sock|g' %s" % (node.name, self.clientConf))
# Change home folder
- node.cmd("export HOME=%s" % self.homeFolder)
+ node.cmd("export HOME=%s" % node.homeFolder)
def start(self):
NdnApplication.start(self, "sudo nfd --config %s 2>> %s &" % (self.confFile, self.logFile))