added core config to jobs and tasks and made use of core variables raw in the tasks
This commit is contained in:
parent
25f83c3ae9
commit
0bfa4b3daa
5 changed files with 23 additions and 21 deletions
|
|
@ -27,21 +27,21 @@ class TcpconnectService(Service):
|
|||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
except socket.error, msg:
|
||||
jobInfo.set_errorcode(2)
|
||||
jobInfo.set_message("Could not create socket to host: " + jobInfo.get_host() + " on port: " +
|
||||
str(self.port) + " (" + str(msg) + ")")
|
||||
jobInfo.set_message("[tcpconnect] Could not create socket to host: " + jobInfo.get_host() +
|
||||
" on port: " + str(self.port) + " (" + str(msg) + ")")
|
||||
|
||||
try:
|
||||
sock.connect((jobInfo.get_host(), self.port))
|
||||
except socket.error, msg:
|
||||
jobInfo.set_errorcode(1)
|
||||
jobInfo.set_message("Could not establish connection to host: " + jobInfo.get_host() + " on port: " +
|
||||
str(self.port) + " (" + str(msg) + ")")
|
||||
jobInfo.set_message("[tcpconnect] Could not establish connection to host: " + jobInfo.get_host() +
|
||||
" on port: " + str(self.port) + " (" + str(msg) + ")")
|
||||
|
||||
if jobInfo.get_errorcode() == -1:
|
||||
jobInfo.set_execution_successful(True)
|
||||
jobInfo.set_errorcode(0)
|
||||
jobInfo.set_message("Connection successful established to host: " + jobInfo.get_host() + " on port: " +
|
||||
str(self.port))
|
||||
jobInfo.set_message("[tcpconnect] Connection successful established to host: " + jobInfo.get_host() +
|
||||
" on port: " + str(self.port))
|
||||
|
||||
sock.close()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue