mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Factored out executing lowdata into something reusable
This commit is contained in:
parent
673e6caa40
commit
38c95ed144
@ -55,16 +55,20 @@ class LowDataAdapter(object):
|
||||
|
||||
return lowdata
|
||||
|
||||
def exec_lowdata(self, lowdata):
|
||||
'''
|
||||
Pass lowdata to Salt to be executed
|
||||
'''
|
||||
# FIXME: change this to yield results from one of Salt's iterative returns
|
||||
logger.debug("SaltAPI is passing low-data: %s", lowdata)
|
||||
return [self.api.run(chunk) for chunk in lowdata]
|
||||
|
||||
@cherrypy.tools.json_out()
|
||||
def POST(self, **kwargs):
|
||||
'''
|
||||
Run a given function in a given client with the given args
|
||||
'''
|
||||
lowdata = self.fmt_lowdata(kwargs)
|
||||
logger.debug("SaltAPI is passing LowData: %s", lowdata)
|
||||
|
||||
# FIXME: change this to yield results from one of Salt's iterative returns
|
||||
return [self.api.run(chunk) for chunk in lowdata]
|
||||
return self.exec_lowdata(self.fmt_lowdata(kwargs))
|
||||
|
||||
class Login(LowDataAdapter):
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user