summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-24 11:59:05 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-24 16:34:46 +0000
commit38b4e330c6c2007e8ead878e1d9e9580d3b19c7b (patch)
tree641701c29c7bfff87c36cc7f262e984417348a6c
parent85e03a64dd0a4ebe71009ec4bdf4192c04a9786e (diff)
downloadbitbake-38b4e330c6c2007e8ead878e1d9e9580d3b19c7b.tar.gz
tinfoil: Add iterator support for DataStoreConnector
Some usages need to iterate the datastore. This is slow and not recommended but support this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/tinfoil.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/bb/tinfoil.py b/lib/bb/tinfoil.py
index 4fbad0774..1164ee601 100644
--- a/lib/bb/tinfoil.py
+++ b/lib/bb/tinfoil.py
@@ -104,6 +104,11 @@ class TinfoilDataStoreConnector:
setattr(self, name, newfunc)
return newfunc
+ def __iter__(self):
+ keys = self.tinfoil.run_command('dataStoreConnectorCmd', self.dsindex, "keys", [], {})
+ for k in keys:
+ yield k
+
class TinfoilCookerAdapter:
"""
Provide an adapter for existing code that expects to access a cooker object via Tinfoil,