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']
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"):
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"):