From fc0434af3f42156b268e0e201f6b2083385c9dc5 Mon Sep 17 00:00:00 2001 From: Julien Tribino Date: Fri, 14 Jun 2013 10:58:44 +0200 Subject: [PATCH 1/1] change PlanetLab to planetlab for the PlanetLab node --- src/nepi/resources/linux/node.py | 4 ++-- src/nepi/resources/omf/application.py | 4 ++-- src/nepi/resources/omf/channel.py | 4 ++-- src/nepi/resources/omf/interface.py | 2 +- src/nepi/resources/omf/node.py | 2 +- src/nepi/resources/planetlab/node.py | 2 +- test/resources/omf/vlc.py | 5 +++++ 7 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/nepi/resources/linux/node.py b/src/nepi/resources/linux/node.py index 50dd2260..de194e59 100644 --- a/src/nepi/resources/linux/node.py +++ b/src/nepi/resources/linux/node.py @@ -184,8 +184,8 @@ class LinuxNode(ResourceManager): def deploy(self): if self.state == ResourceState.NEW: try: - self.discover() - self.provision() + self.discover() + self.provision() except: self._state = ResourceState.FAILED raise diff --git a/src/nepi/resources/omf/application.py b/src/nepi/resources/omf/application.py index 22c8dca4..6da1160a 100644 --- a/src/nepi/resources/omf/application.py +++ b/src/nepi/resources/omf/application.py @@ -144,7 +144,7 @@ class OMFApplication(ResourceManager): self._state = ResourceState.FAILED msg = "Credentials are not initialzed. XMPP Connections impossible" self.error(msg) - return + raise else : self._state = ResourceState.FAILED msg = "Application's information are not initialized" @@ -163,7 +163,7 @@ class OMFApplication(ResourceManager): self._state = ResourceState.FAILED msg = "Credentials were not initialzed. XMPP Connections impossible" self.error(msg) - return + raise super(OMFApplication, self).stop() self._state = ResourceState.FINISHED diff --git a/src/nepi/resources/omf/channel.py b/src/nepi/resources/omf/channel.py index 02974a88..fa8df03b 100644 --- a/src/nepi/resources/omf/channel.py +++ b/src/nepi/resources/omf/channel.py @@ -153,7 +153,7 @@ class OMFChannel(ResourceManager): self._state = ResourceState.FAILED msg = "Credentials are not initialzed. XMPP Connections impossible" self.debug(msg) - return + raise else : msg = "Channel's value is not initialized" self.error(msg) @@ -170,7 +170,7 @@ class OMFChannel(ResourceManager): def stop(self): """Stop the RM. It means nothing special for a channel for now - It becomes STOPPED as soon as this method stops + It becomes STOPPED as soon as this method is called """ super(OMFChannel, self).stop() diff --git a/src/nepi/resources/omf/interface.py b/src/nepi/resources/omf/interface.py index e9877a1c..0e1dad9d 100644 --- a/src/nepi/resources/omf/interface.py +++ b/src/nepi/resources/omf/interface.py @@ -133,7 +133,7 @@ class OMFWifiInterface(ResourceManager): self._state = ResourceState.FAILED msg = "Credentials are not initialzed. XMPP Connections impossible" self.debug(msg) - return + raise else : msg = "The channel is connected with an undefined node" self.error(msg) diff --git a/src/nepi/resources/omf/node.py b/src/nepi/resources/omf/node.py index 95f630b5..4658cb54 100644 --- a/src/nepi/resources/omf/node.py +++ b/src/nepi/resources/omf/node.py @@ -134,7 +134,7 @@ class OMFNode(ResourceManager): self._state = ResourceState.FAILED msg = "Credentials are not initialzed. XMPP Connections impossible" self.debug(msg) - return + raise AttributeError, msg super(OMFNode, self).deploy() diff --git a/src/nepi/resources/planetlab/node.py b/src/nepi/resources/planetlab/node.py index cbfd1d54..45cd3a3a 100644 --- a/src/nepi/resources/planetlab/node.py +++ b/src/nepi/resources/planetlab/node.py @@ -162,7 +162,7 @@ class PlanetlabNode(LinuxNode): cls._register_attribute(timeframe) def __init__(self, ec, guid): - super(PLanetLabNode, self).__init__(ec, guid) + super(PLanetlabNode, self).__init__(ec, guid) self._plapi = None diff --git a/test/resources/omf/vlc.py b/test/resources/omf/vlc.py index aae3084a..6a448796 100755 --- a/test/resources/omf/vlc.py +++ b/test/resources/omf/vlc.py @@ -124,6 +124,11 @@ class OMFVLCTestCase(unittest.TestCase): self.ec.set(self.app2, 'xmppPassword', "1234") self.app3 = self.ec.register_resource("OMFApplication") + self.ec.set(self.app3, 'appid', 'Kill#2') + self.ec.set(self.app3, 'path', "/usr/bin/killall") + self.ec.set(self.app3, 'args', "vlc") + self.ec.set(self.app3, 'env', " ") + self.app4 = self.ec.register_resource("OMFApplication") self.app5 = self.ec.register_resource("OMFApplication") -- 2.43.0