[5/5] data_smart: Add hasOverrides method to public datastore API

Message ID 20220216113158.2899964-5-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit c885e5542dcf760b8fc5881e385abb4a10020874
Headers show
Series [1/5] data_smart: Fix overrides file/line message additions | expand

Commit Message

Richard Purdie Feb. 16, 2022, 11:31 a.m. UTC
There are some cases where the metadata needs to check if a variable
has any overrides set, even if they are currently inactive. That code
currently pokes into datastore internals. Add API instead to replace
and avoid that.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
 lib/bb/data_smart.py | 2 ++
 1 file changed, 2 insertions(+)


diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index 242476be0e..cb2d4b620f 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -488,6 +488,8 @@  class DataSmart(MutableMapping):
+    def hasOverrides(self, var):
+        return var in self.overridedata
     def setVar(self, var, value, **loginfo):
         #print("var=" + str(var) + "  val=" + str(value))