X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=examples%2Fplanetlab%2Fping.py;h=f35ea702841ba44b8c61ccef7c4cd45b65ac5f94;hb=039fbd9629d7570d4c175a5448d24badcd0f3aba;hp=e36ba61fc2234d541d0e8c4a4aec0dd8501dc12d;hpb=73e280a3141f47a795d46b4cc23b290bd2b4c68a;p=nepi.git diff --git a/examples/planetlab/ping.py b/examples/planetlab/ping.py index e36ba61f..f35ea702 100644 --- a/examples/planetlab/ping.py +++ b/examples/planetlab/ping.py @@ -4,9 +4,8 @@ # Copyright (C) 2013 INRIA # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation; # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -25,6 +24,7 @@ # $ cd # python examples/planetlab/ping.py -s -u -p -k +from __future__ import print_function from nepi.execution.ec import ExperimentController @@ -56,7 +56,7 @@ pl_password = options.pl_password ec = ExperimentController(exp_id = "pl_ping") # Register a Planetlab Node with no restrictions, it can be any node -node = ec.register_resource("PlanetlabNode") +node = ec.register_resource("planetlab::Node") # The username in this case is the slice name, the one to use for login in # via ssh into PlanetLab nodes. Replace with your own slice name. @@ -69,11 +69,11 @@ ec.set(node, "pluser", pl_user) ec.set(node, "plpassword", pl_password) # Remove previous results -ec.set(node, "cleanHome", True) +ec.set(node, "cleanExperiment", True) ec.set(node, "cleanProcesses", True) # Define a ping application -app = ec.register_resource("LinuxApplication") +app = ec.register_resource("linux::Application") ec.set(app, "command", "ping -c3 nepi.inria.fr") # Connect the application to the node @@ -87,9 +87,9 @@ ec.wait_finished(app) trace = ec.trace(app, "stdout") -print "PING outout ", trace +print("PING outout ", trace) -# Do the experiment controller shutdown: +# Do the experiment controller shutdown ec.shutdown() # END