master
Simon 2 years ago
parent 0936f90c49
commit 89376ded87

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

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

Loading…
Cancel
Save

Powered by TurnKey Linux.