Allow specification of working directory via constructor argument and related cleanup
Change-Id: Ifc73371c920d1d4e47b1fa04e57de5aebd2a6b40
diff --git a/examples/ping-demo.py b/examples/ping-demo.py
index 550c0df..5db8087 100644
--- a/examples/ping-demo.py
+++ b/examples/ping-demo.py
@@ -80,7 +80,7 @@
# Start ping server
info("Starting pings...\n")
- pingserver_log = open("/tmp/minindn/c/ndnpingserver.log", "w")
+ pingserver_log = open("{}/c/ndnpingserver.log".format(ndn.workDir), "w")
getPopen(ndn.net["c"], "ndnpingserver {}".format(PREFIX), stdout=pingserver_log,\
stderr=pingserver_log)
diff --git a/examples/psync/full_sync.py b/examples/psync/full_sync.py
index d256a3b..d74a284 100644
--- a/examples/psync/full_sync.py
+++ b/examples/psync/full_sync.py
@@ -68,7 +68,7 @@
time.sleep(300)
totalUpdates = int(host.cmd('grep -r Update {}/*/psync.logs | wc -l'
- .format(args.workDir)))
+ .format(ndn.workDir)))
expectedUpdates = (maxUpdatesPerUserPrefixPerNode *
len(ndn.net.hosts) * (len(ndn.net.hosts) - 1) * numUserPrefixesPerNode)
diff --git a/examples/traffic_generator.py b/examples/traffic_generator.py
index 48bbd07..d67e7e2 100644
--- a/examples/traffic_generator.py
+++ b/examples/traffic_generator.py
@@ -25,7 +25,7 @@
"""
This example demonstrates the functionality of the Traffic generator. It consists of a traffic
server and client. The server will listen for interest on the prefix specified in the server
-configuration file. The client will send a designated number of interests to the server and
+configuration file. The client will send a designated number of interests to the server and
get the data back.
More details on traffic generator here: https://github.com/named-data/ndn-traffic-generator
"""
@@ -91,8 +91,8 @@
# lets make node "a" as a traffic-server node, and node "c" as a traffic-client node
server = ndn.net['a']
client = ndn.net['c']
- serverConf = '{}/{}/server-conf'.format(ndn.args.workDir, server.name)
- clientConf = '{}/{}/client-conf'.format(ndn.args.workDir, client.name)
+ serverConf = '{}/{}/server-conf'.format(ndn.workDir, server.name)
+ clientConf = '{}/{}/client-conf'.format(ndn.workDir, client.name)
copyExistentFile(server, possibleServerConfPath, serverConf)
copyExistentFile(server, possibleClientConfPath, clientConf)