Fixes in updates
This commit is contained in:
parent
55a1075c3a
commit
9161c35cac
2 changed files with 10 additions and 6 deletions
|
|
@ -39,8 +39,10 @@ class UpdateServerScripts(WebModel):
|
||||||
super().__init__(connection)
|
super().__init__(connection)
|
||||||
self.register(corefields.CharField('name'), True)
|
self.register(corefields.CharField('name'), True)
|
||||||
self.register(FileField('file', './scripts/local/'), True)
|
self.register(FileField('file', './scripts/local/'), True)
|
||||||
|
self.register(corefields.CharField('args'))
|
||||||
self.register(corefields.ForeignKeyField('server_id', ServerDbTask(connection), 11, False, 'id', 'group', select_fields=[]))
|
self.register(corefields.ForeignKeyField('server_id', ServerDbTask(connection), 11, False, 'id', 'group', select_fields=[]))
|
||||||
self.register(corefields.IntegerField('position'))
|
self.register(corefields.IntegerField('position'))
|
||||||
|
self.register(corefields.CharField('code'))
|
||||||
|
|
||||||
class NameServerScripts(WebModel):
|
class NameServerScripts(WebModel):
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,13 @@ class ServerTask(Task):
|
||||||
|
|
||||||
arr_server=serverdb.set_conditions('WHERE ip=%s', [server]).select_a_row_where()
|
arr_server=serverdb.set_conditions('WHERE ip=%s', [server]).select_a_row_where()
|
||||||
|
|
||||||
update_server=UpdateServerScripts(conn)
|
if arr_server:
|
||||||
|
|
||||||
arr_update=update_server.set_conditions('WHERE server_id=%s', [arr_server['id']]).select_to_array()
|
update_server=UpdateServerScripts(conn)
|
||||||
|
|
||||||
for upd in arr_update:
|
arr_update=update_server.set_conditions('WHERE server_id=%s', [arr_server['id']]).select_to_array()
|
||||||
|
|
||||||
self.files.append([upd['file'], 0o755])
|
for upd in arr_update:
|
||||||
self.commands_to_execute.append([upd['file'], ''])
|
|
||||||
|
self.files.append([upd['file'], 0o755])
|
||||||
|
self.commands_to_execute.append([upd['file'], upd['args']])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue