Fixes in dashboard, added distro field for serverdbtask table
This commit is contained in:
parent
7a0b0abbdb
commit
8a0354b85b
5 changed files with 28 additions and 3 deletions
|
|
@ -1,5 +1,7 @@
|
|||
from modules.pastafari2.libraries.task import Task
|
||||
from modules.pastafari2.models.pastafari2 import ServerDbTask
|
||||
from modules.pastafari2.models.tasks import ResultTask
|
||||
import json
|
||||
|
||||
class ServerTask(Task):
|
||||
|
||||
|
|
@ -35,12 +37,22 @@ class ServerTask(Task):
|
|||
|
||||
def post_task(self):
|
||||
|
||||
distro=''
|
||||
|
||||
resulttask=ResultTask(self.connection)
|
||||
|
||||
arr_result=resulttask.set_conditions('WHERE task_id=%s', [self.id]).select_a_row_where()
|
||||
|
||||
if arr_result:
|
||||
#r=json.loads(arr_result['message'])
|
||||
distro=json.loads(arr_result['message'])['distro']
|
||||
|
||||
server=ServerDbTask(self.connection)
|
||||
|
||||
server.safe_query()
|
||||
|
||||
#'subdomain_id': self.data['subdomain_id']
|
||||
|
||||
server.insert({'hostname': self.data['hostname'], 'ip': self.data['ip'], 'group_id': self.data['group_id'], 'ssh_port': self.port})
|
||||
server.insert({'hostname': self.data['hostname'], 'ip': self.data['ip'], 'group_id': self.data['group_id'], 'ssh_port': self.port, 'distro': distro})
|
||||
|
||||
return True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue