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
Replacing _backend for _platform class attribute in ResourceManager
[nepi.git]
/
src
/
nepi
/
resources
/
planetlab
/
openvswitch
/
ovs.py
diff --git
a/src/nepi/resources/planetlab/openvswitch/ovs.py
b/src/nepi/resources/planetlab/openvswitch/ovs.py
index
a2111f4
..
171750f
100644
(file)
--- a/
src/nepi/resources/planetlab/openvswitch/ovs.py
+++ b/
src/nepi/resources/planetlab/openvswitch/ovs.py
@@
-15,8
+15,9
@@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-# Author: Alina Quereilhac <alina.quereilhac@inria.fr>
+# Author
s
: Alina Quereilhac <alina.quereilhac@inria.fr>
# Alexandros Kouvakas <alexandros.kouvakas@inria.fr>
# Alexandros Kouvakas <alexandros.kouvakas@inria.fr>
+# Julien Tribino <julien.tribino@inria.fr>
from nepi.execution.resource import ResourceManager, clsinit_copy, \
from nepi.execution.resource import ResourceManager, clsinit_copy, \
@@
-26,8
+27,6
@@
from nepi.resources.planetlab.node import PlanetlabNode
from nepi.resources.linux.application import LinuxApplication
import os
from nepi.resources.linux.application import LinuxApplication
import os
-reschedule_delay = "0.5s"
-
@clsinit_copy
class OVSSwitch(LinuxApplication):
"""
@clsinit_copy
class OVSSwitch(LinuxApplication):
"""
@@
-40,11
+39,11
@@
class OVSSwitch(LinuxApplication):
"""
"""
- _rtype = "OVSSwitch"
+ _rtype = "
planetlab::
OVSSwitch"
_help = "Runs an OpenVSwitch on a PlanetLab host"
_help = "Runs an OpenVSwitch on a PlanetLab host"
- _
backend
= "planetlab"
+ _
platform
= "planetlab"
- _authorized_connections = ["
PlanetlabNode", "OVSPort", "Linux
Node"]
+ _authorized_connections = ["
planetlab::Node", "planetla::OVSPort", "linux::
Node"]
@classmethod
def _register_attributes(cls):
@classmethod
def _register_attributes(cls):
@@
-52,13
+51,13
@@
class OVSSwitch(LinuxApplication):
"""
bridge_name = Attribute("bridge_name", "Name of the switch/bridge",
"""
bridge_name = Attribute("bridge_name", "Name of the switch/bridge",
- flags = Flags.
ExecReadOnly)
+ flags = Flags.
Design)
virtual_ip_pref = Attribute("virtual_ip_pref", "Virtual IP/PREFIX of the switch",
virtual_ip_pref = Attribute("virtual_ip_pref", "Virtual IP/PREFIX of the switch",
- flags = Flags.
ExecReadOnly)
+ flags = Flags.
Design)
controller_ip = Attribute("controller_ip", "IP of the controller",
controller_ip = Attribute("controller_ip", "IP of the controller",
- flags = Flags.
ExecReadOnly)
+ flags = Flags.
Design)
controller_port = Attribute("controller_port", "Port of the controller",
controller_port = Attribute("controller_port", "Port of the controller",
- flags = Flags.
ExecReadOnly)
+ flags = Flags.
Design)
cls._register_attribute(bridge_name)
cls._register_attribute(virtual_ip_pref)
cls._register_attribute(bridge_name)
cls._register_attribute(virtual_ip_pref)
@@
-132,7
+131,7
@@
class OVSSwitch(LinuxApplication):
"""
if not self.node or self.node.state < ResourceState.READY:
"""
if not self.node or self.node.state < ResourceState.READY:
- self.ec.schedule(reschedule_delay, self.deploy)
+ self.ec.schedule(
self.
reschedule_delay, self.deploy)
return
self.do_discover()
return
self.do_discover()
@@
-296,11
+295,12
@@
class OVSSwitch(LinuxApplication):
"""
from nepi.resources.planetlab.openvswitch.ovsport import OVSPort
"""
from nepi.resources.planetlab.openvswitch.ovsport import OVSPort
- rm = self.get_connected(OVSPort.get_rtype())
+ rm
s
= self.get_connected(OVSPort.get_rtype())
- if rm[0].state < ResourceState.RELEASED:
- self.ec.schedule(reschedule_delay, self.release)
- return
+ for rm in rms :
+ if rm.state < ResourceState.RELEASED:
+ self.ec.schedule(self.reschedule_delay, self.release)
+ return
cmd = "sliver-ovs del-bridge %s" % self.get('bridge_name')
(out, err), proc = self.node.run(cmd, self.ovs_checks,
cmd = "sliver-ovs del-bridge %s" % self.get('bridge_name')
(out, err), proc = self.node.run(cmd, self.ovs_checks,