Cleaning up examples folder
[nepi.git] / examples / linux / ccn / ccncat_2_nodes.py
old mode 100755 (executable)
new mode 100644 (file)
index 60d4362..7efe118
 #                
 #                 
 #  content                ccncat
-#  PL host               Linux host
+#  Linux host               Linux host
 #  0 ------- Internet ------ 0
 #           
 
 from nepi.execution.ec import ExperimentController, ECState 
-from nepi.execution.resource import ResourceState, ResourceAction, \
-        populate_factory
+from nepi.execution.resource import ResourceState, ResourceAction 
 from nepi.resources.linux.node import OSType
 
 from optparse import OptionParser, SUPPRESS_HELP
 
+import getpass
 import os
 import time
 
@@ -152,7 +152,8 @@ def get_options():
     #       the host can be accessed through SSH without prompting
     #       for a password. The host must allow X forwarding using SSH.
     linux_host = 'roseval.pl.sophia.inria.fr'
-
+    linux_user = getpass.getuser()
+    
     usage = "usage: %prog -p <pl-host> -s <pl-slice> -l <linux-host> -u <linux-user> -m <movie> -e <exp-id> -i <ssh_key>"
 
     parser = OptionParser(usage=usage)
@@ -165,8 +166,8 @@ def get_options():
             help="Hostname of second Linux host (non PlanetLab)",
             default = linux_host, type="str")
     parser.add_option("-u", "--linux-user", dest="linux_user", 
-            help="User for extra Linux host (non PlanetLab)", default = linux_host,
-            type="str")
+            help="User for extra Linux host (non PlanetLab)", 
+            default = linux_user, type="str")
     parser.add_option("-m", "--movie", dest="movie", 
             help="Stream movie", type="str")
     parser.add_option("-e", "--exp-id", dest="exp_id", 
@@ -188,9 +189,6 @@ if __name__ == '__main__':
     ( pl_host, pl_user, linux_host, linux_user, movie, exp_id, pl_ssh_key 
             ) = get_options()
 
-    # Search for available RMs
-    populate_factory()
-    
     # Create the ExperimentController instance
     ec = ExperimentController(exp_id = exp_id)