git://git.onelab.eu
/
nepi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use print() - import print_function - should be fine for both py2 and py3
[nepi.git]
/
examples
/
linux
/
vlc_streaming.py
diff --git
a/examples/linux/vlc_streaming.py
b/examples/linux/vlc_streaming.py
index
49e2e7e
..
4b5d83d
100644
(file)
--- a/
examples/linux/vlc_streaming.py
+++ b/
examples/linux/vlc_streaming.py
@@
-3,9
+3,8
@@
# Copyright (C) 2014 INRIA
#
# This program is free software: you can redistribute it and/or modify
# Copyright (C) 2014 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
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-22,6
+21,8
@@
# $ cd <path-to-nepi>
# python examples/linux/vlc_streaming.py -a <hostname1> -b <hostname2> -u <username> -i <ssh-key>
# $ cd <path-to-nepi>
# python examples/linux/vlc_streaming.py -a <hostname1> -b <hostname2> -u <username> -i <ssh-key>
+from __future__ import print_function
+
from nepi.execution.ec import ExperimentController
from nepi.execution.resource import ResourceState, ResourceAction
from nepi.execution.ec import ExperimentController
from nepi.execution.resource import ResourceState, ResourceAction
@@
-51,7
+52,7
@@
ssh_key = options.ssh_key
ec = ExperimentController(exp_id = "vlc_streamming")
## Register node 1
ec = ExperimentController(exp_id = "vlc_streamming")
## Register node 1
-node1 = ec.register_resource("
Linux
Node")
+node1 = ec.register_resource("
linux::
Node")
# Set the hostname of the first node to use for the experiment
ec.set(node1, "hostname", hostname1)
# username should be your SSH user
# Set the hostname of the first node to use for the experiment
ec.set(node1, "hostname", hostname1)
# username should be your SSH user
@@
-64,7
+65,7
@@
ec.set(node1, "cleanExperiment", True)
ec.set(node1, "cleanProcesses", True)
## Register node 2
ec.set(node1, "cleanProcesses", True)
## Register node 2
-node2 = ec.register_resource("
Linux
Node")
+node2 = ec.register_resource("
linux::
Node")
# Set the hostname of the first node to use for the experiment
ec.set(node2, "hostname", hostname2)
# username should be your SSH user
# Set the hostname of the first node to use for the experiment
ec.set(node2, "hostname", hostname2)
# username should be your SSH user
@@
-87,7
+88,7
@@
command = ("sudo -S dbus-uuidgen --ensure; sleep 3;"
"--sout '#rtp{dst=%s,port=5004,mux=ts}' vlc://quit") % \
(video, hostname2)
"--sout '#rtp{dst=%s,port=5004,mux=ts}' vlc://quit") % \
(video, hostname2)
-server = ec.register_resource("
Linux
Application")
+server = ec.register_resource("
linux::
Application")
ec.set(server, "depends", "vlc")
ec.set(server, "files", local_path_to_video)
ec.set(server, "command", command)
ec.set(server, "depends", "vlc")
ec.set(server, "files", local_path_to_video)
ec.set(server, "command", command)
@@
-99,7
+100,7
@@
command = ("sudo -S dbus-uuidgen --ensure; sleep 3; "
"--sout '#std{access=file,mux=ts,dst=VIDEO}'") % \
(hostname2, video)
"--sout '#std{access=file,mux=ts,dst=VIDEO}'") % \
(hostname2, video)
-client = ec.register_resource("
Linux
Application")
+client = ec.register_resource("
linux::
Application")
ec.set(client, "depends", "vlc")
ec.set(client, "command", command)
ec.register_connection(client, node2)
ec.set(client, "depends", "vlc")
ec.set(client, "command", command)
ec.register_connection(client, node2)
@@
-121,5
+122,5
@@
f.close()
ec.shutdown()
ec.shutdown()
-print
"Streamed VIDEO stored localy at video.ts"
+print
("Streamed VIDEO stored localy at video.ts")