master
Simon 2 years ago
parent 0936f90c49
commit 89376ded87

@ -59,6 +59,9 @@ class FD_APIUserDefinedContext(object):
def options(self,system,options):
self.CONFIG['SYSTEMS'][system]['OPTIONS'] = options
def getoptions(self,system):
return self.CONFIG['SYSTEMS'][system]['OPTIONS']
def killserver(self):
self.CONFIG['GLOBAL']['_KILL_SERVER'] = True
@ -79,7 +82,7 @@ class FD_API(ServiceBase):
######################
#User level API calls#
######################
@rpc(Unicode,Unicode)
@rpc(UnsignedInteger32,Unicode)
def reset(ctx,dmrid,key):
system = ctx.udc.validateKey(int(dmrid),key)
if system:
@ -95,7 +98,13 @@ class FD_API(ServiceBase):
else:
raise error.InvalidCredentialsError()
@rpc(UnsignedInteger32,Unicode)
def getoptions(ctx,dmrid,key):
system = ctx.udc.validateKey(int(dmrid),key)
if system:
return ctx.udc.getoptions(system,options)
else:
raise error.InvalidCredentialsError()
########################
#System level API calls#

@ -362,9 +362,12 @@ if __name__ == '__main__':
print('(PROXY)(GLOBAL) SHUTDOWN: PROXY IS TERMINATING WITH SIGNAL {}'.format(str(_signal)))
reactor.stop()
def sigt(_signal,_frame):
print('oooh')
#Install signal handlers
signal.signal(signal.SIGINT, sig_handler)
signal.signal(signal.SIGTERM, sig_handler)
signal.signal(signal.SIGTERM, sigt)
#readState()

Loading…
Cancel
Save

Powered by TurnKey Linux.