mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
bitbake: tinfoil/data_smart: Allow variable history emit() to function remotely
We can't access the emit() function of varhistory currently as the datastore parameter isn't handled correctly, nor is the output stream. Add a custom wrapper for this function which handles the two details correctly. (Bitbake rev: ba0fa084ccd2b1ade96425d158fd31e49e42f286) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -20,6 +20,7 @@ Commands are queued in a CommandQueue
|
|||||||
|
|
||||||
from collections import OrderedDict, defaultdict
|
from collections import OrderedDict, defaultdict
|
||||||
|
|
||||||
|
import io
|
||||||
import bb.event
|
import bb.event
|
||||||
import bb.cooker
|
import bb.cooker
|
||||||
import bb.remotedata
|
import bb.remotedata
|
||||||
@@ -500,6 +501,17 @@ class CommandsSync:
|
|||||||
d = command.remotedatastores[dsindex].varhistory
|
d = command.remotedatastores[dsindex].varhistory
|
||||||
return getattr(d, method)(*args, **kwargs)
|
return getattr(d, method)(*args, **kwargs)
|
||||||
|
|
||||||
|
def dataStoreConnectorVarHistCmdEmit(self, command, params):
|
||||||
|
dsindex = params[0]
|
||||||
|
var = params[1]
|
||||||
|
oval = params[2]
|
||||||
|
val = params[3]
|
||||||
|
d = command.remotedatastores[params[4]]
|
||||||
|
|
||||||
|
o = io.StringIO()
|
||||||
|
command.remotedatastores[dsindex].varhistory.emit(var, oval, val, o, d)
|
||||||
|
return o.getvalue()
|
||||||
|
|
||||||
def dataStoreConnectorIncHistCmd(self, command, params):
|
def dataStoreConnectorIncHistCmd(self, command, params):
|
||||||
dsindex = params[0]
|
dsindex = params[0]
|
||||||
method = params[1]
|
method = params[1]
|
||||||
|
|||||||
@@ -52,6 +52,10 @@ class TinfoilDataStoreConnectorVarHistory:
|
|||||||
def remoteCommand(self, cmd, *args, **kwargs):
|
def remoteCommand(self, cmd, *args, **kwargs):
|
||||||
return self.tinfoil.run_command('dataStoreConnectorVarHistCmd', self.dsindex, cmd, args, kwargs)
|
return self.tinfoil.run_command('dataStoreConnectorVarHistCmd', self.dsindex, cmd, args, kwargs)
|
||||||
|
|
||||||
|
def emit(self, var, oval, val, o, d):
|
||||||
|
ret = self.tinfoil.run_command('dataStoreConnectorVarHistCmdEmit', self.dsindex, var, oval, val, d.dsindex)
|
||||||
|
o.write(ret)
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
if not hasattr(bb.data_smart.VariableHistory, name):
|
if not hasattr(bb.data_smart.VariableHistory, name):
|
||||||
raise AttributeError("VariableHistory has no such method %s" % name)
|
raise AttributeError("VariableHistory has no such method %s" % name)
|
||||||
|
|||||||
Reference in New Issue
Block a user