From cbc22a0a9aadc8606b927dbac0f1407ec2736b35 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Tue, 13 Dec 2016 20:07:09 +1300 Subject: tinfoil: pass datastore to server when expanding python references If you're expanding a value that refers to the value of a variable in python code, we need to ensure that the datastore that gets used to get the value of that variable is the client-side datastore and not just the part of it that's on the server side. For example, suppose you are in client code doing the following: d.setVar('HELLO', 'there') result = d.expand('${@d.getVar("HELLO", True)}') result should be "there" but if the client part wasn't taken into account, it would be whatever value HELLO had in the server portion of the datastore (if any). Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- lib/bb/tinfoil.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/bb/tinfoil.py') diff --git a/lib/bb/tinfoil.py b/lib/bb/tinfoil.py index c551a9f1f..720bf4b93 100644 --- a/lib/bb/tinfoil.py +++ b/lib/bb/tinfoil.py @@ -29,6 +29,7 @@ import bb.providers import bb.taskdata import bb.utils import bb.command +import bb.remotedata from bb.cookerdata import CookerConfiguration, ConfigParameters from bb.main import setup_bitbake, BitBakeConfigParameters, BBMainException import bb.fetch2 @@ -69,8 +70,9 @@ class TinfoilDataStoreConnector: return set(self.tinfoil.run_command('dataStoreConnectorGetKeys', self.dsindex)) def getVarHistory(self, name): return self.tinfoil.run_command('dataStoreConnectorGetVarHistory', self.dsindex, name) - def expandPythonRef(self, varname, expr): - ret = self.tinfoil.run_command('dataStoreConnectorExpandPythonRef', self.dsindex, varname, expr) + def expandPythonRef(self, varname, expr, d): + ds = bb.remotedata.RemoteDatastores.transmit_datastore(d) + ret = self.tinfoil.run_command('dataStoreConnectorExpandPythonRef', ds, varname, expr) return ret def setVar(self, varname, value): if self.dsindex is None: -- cgit 1.2.3-korg