From dd21d98ce255bbfc5da41dd158df5efdc0c1d34e Mon Sep 17 00:00:00 2001 From: salimfadhley Date: Mon, 17 Jun 2013 23:44:45 +0100 Subject: [PATCH] we dont need no steenking accessor functions. --- jenkinsapi/node.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/jenkinsapi/node.py b/jenkinsapi/node.py index 5fcb6a4..59555f3 100644 --- a/jenkinsapi/node.py +++ b/jenkinsapi/node.py @@ -27,9 +27,6 @@ class Node(JenkinsBase): def __str__(self): return self.name - def get_node_data(self): - return self._data - def is_online(self): self.poll() return not self._data['offline'] @@ -46,25 +43,25 @@ class Node(JenkinsBase): def set_online(self): - """ + """ Set node online. - Before change state verify client state: if node set 'offline' but 'temporarilyOffline' + Before change state verify client state: if node set 'offline' but 'temporarilyOffline' is not set - client has connection problems and AssertionError raised. If after run node state has not been changed raise AssertionError. """ self.poll() # Before change state check if client is connected if self._data['offline'] and not self._data['temporarilyOffline']: - raise AssertionError("Node is offline and not marked as temporarilyOffline" + - ", check client connection: " + - "offline = %s , temporarilyOffline = %s" % + raise AssertionError("Node is offline and not marked as temporarilyOffline" + + ", check client connection: " + + "offline = %s , temporarilyOffline = %s" % (self._data['offline'], self._data['temporarilyOffline'])) elif self._data['offline'] and self._data['temporarilyOffline']: self.toggle_temporarily_offline() self.poll() if self._data['offline']: - raise AssertionError("The node state is still offline, check client connection:" + - " offline = %s , temporarilyOffline = %s" % + raise AssertionError("The node state is still offline, check client connection:" + + " offline = %s , temporarilyOffline = %s" % (self._data['offline'], self._data['temporarilyOffline'])) def set_offline(self, message="requested from jenkinsapi"): @@ -78,8 +75,8 @@ class Node(JenkinsBase): self.toggle_temporarily_offline(message) self.poll() if not self._data['offline']: - raise AssertionError("The node state is still online:" + - "offline = %s , temporarilyOffline = %s" % + raise AssertionError("The node state is still online:" + + "offline = %s , temporarilyOffline = %s" % (self._data['offline'], self._data['temporarilyOffline'])) def toggle_temporarily_offline(self, message="requested from jenkinsapi"): -- 2.7.4