toasterui.py: warn if buildstats is missing
PATCH 1/1 toasterui.py: warn if buildstats is missing
Like for buildhistory and INHERIT, warn if buildstats is missing from USER_CLASSES.
--- lib/bb/ui/toasterui.py | 5 +++++ 1 file changed, 5 insertions(+)
lib/bb/ui/toasterui.py +5 -0
@@ -168,6 +168,11 @@ def main(server, eventHandler, params): logger.warning("buildhistory is not enabled. Please enable INHERIT += \"buildhistory\" to see image details.") build_history_enabled = False + userclasseslist, _ = server.runCommand(["getVariable", "USER_CLASSES"]) + + if not "buildstats" in userclasseslist.split(" "): + logger.warning("buildstats is not enabled. Please enable USER_CLASSES += \"buildstats\" to generate build statistics.") + if not params.observe_only: params.updateFromServer(server) params.updateToServer(server, os.environ.copy())
Signature · 1 line
2.1.4
Quoted 15 lines · Olaf Mandel
Like for buildhistory and INHERIT, warn if buildstats is missing from
USER_CLASSES.Signed-off-by Olaf Mandel <[email protected]>---
lib/bb/ui/toasterui.py | 5 +++++1 file changed, 5 insertions(+)lib/bb/ui/toasterui.py +0
-0@@ -168,6 +168,11 @@ def main(server, eventHandler, params):logger.warning("buildhistory is not enabled. Please enable INHERIT += \"buildhistory\" to see image details.")
Quoted 8 lines
build_history_enabled = False
+ userclasseslist, _ =server.runCommand(["getVariable", "USER_CLASSES"])
+
+ if not "buildstats" inuserclasseslist.split(" "):
+ logger.warning("buildstats is not enabled. Please enableUSER_CLASSES+= \"buildstats\" to generate build statistics.")
As USER_CLASSES is an intermediate variable whose value becomes part of the INHERIT assignment it'd be better to check whether buildstats is in INHERIT, rather than USER_CLASSES.
This should better handle configurations which include buildstats in a different manner.
Quoted 7 lines
+
if not params.observe_only:
params.updateFromServer(server)params.updateToServer(server, os.environ.copy())--
2.1.4
PATCH v2 1/1 toasterui.py: warn if buildstats is missing
Like for buildhistory, warn if buildstats is missing from INHERIT.
--- lib/bb/ui/toasterui.py | 3 +++ 1 file changed, 3 insertions(+)
lib/bb/ui/toasterui.py +3 -0
@@ -168,6 +168,9 @@ def main(server, eventHandler, params): logger.warning("buildhistory is not enabled. Please enable INHERIT += \"buildhistory\" to see image details.") build_history_enabled = False + if not "buildstats" in inheritlist.split(" "): + logger.warning("buildstats is not enabled. Please enable INHERIT += \"buildstats\" to generate build statistics.") + if not params.observe_only: params.updateFromServer(server) params.updateToServer(server, os.environ.copy())
Signature · 1 line
2.1.4