X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=examples%2Flinux%2Ftesting%2Fccncat_extended_ring_topo.py;h=2e5cce81bb1274233d25faa70a0907589f633ae4;hb=2ff5b287769a5772968642c7b145062856e06f0f;hp=af823a2674d59f9cff899d2df209e1233708e470;hpb=e7eb6ef8873e1e197b3db8842f67a483c004a77a;p=nepi.git diff --git a/examples/linux/testing/ccncat_extended_ring_topo.py b/examples/linux/testing/ccncat_extended_ring_topo.py index af823a26..2e5cce81 100644 --- a/examples/linux/testing/ccncat_extended_ring_topo.py +++ b/examples/linux/testing/ccncat_extended_ring_topo.py @@ -5,9 +5,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 @@ -49,33 +48,33 @@ import os import time def add_node(ec, host, user, ssh_key = None): - node = ec.register_resource("LinuxNode") + node = ec.register_resource("linuxNode") ec.set(node, "hostname", host) ec.set(node, "username", user) ec.set(node, "identity", ssh_key) - ec.set(node, "cleanHome", True) + ec.set(node, "cleanExperiment", True) ec.set(node, "cleanProcesses", True) return node def add_ccnd(ec, node): - ccnd = ec.register_resource("LinuxCCND") + ccnd = ec.register_resource("linux::CCND") ec.set(ccnd, "debug", 7) ec.register_connection(ccnd, node) return ccnd def add_ccnr(ec, ccnd): - ccnr = ec.register_resource("LinuxCCNR") + ccnr = ec.register_resource("linux::CCNR") ec.register_connection(ccnr, ccnd) return ccnr def add_fib_entry(ec, ccnd, peer_host): - entry = ec.register_resource("LinuxFIBEntry") + entry = ec.register_resource("linux::FIBEntry") ec.set(entry, "host", peer_host) ec.register_connection(entry, ccnd) return entry def add_content(ec, ccnr, content_name, content): - co = ec.register_resource("LinuxCCNContent") + co = ec.register_resource("linux::CCNContent") ec.set(co, "contentName", content_name) ec.set(co, "content", content) ec.register_connection(co, ccnr) @@ -86,7 +85,7 @@ def add_stream(ec, ccnd, content_name): command = "ccnpeek %(content_name)s; ccncat %(content_name)s" % { "content_name" : content_name} - app = ec.register_resource("LinuxCCNApplication") + app = ec.register_resource("linux::CCNApplication") ec.set(app, "command", command) ec.register_connection(app, ccnd) @@ -157,7 +156,7 @@ if __name__ == '__main__': ring_hosts = [host1, host2, host3, host4] ccnds = dict() - for i in xrange(len(ring_hosts)): + for i in range(len(ring_hosts)): host = ring_hosts[i] node = add_node(ec, host, pl_user, pl_ssh_key) ccnd = add_ccnd(ec, node) @@ -214,7 +213,7 @@ if __name__ == '__main__': # Register a collector to automatically collect traces collector = add_collector(ec, "stderr") - for ccnd in ccnds.values(): + for ccnd in ccnds: ec.register_connection(collector, ccnd) # deploy all ResourceManagers