From 99730d64d4b83ce37d4b3f5a7f992512fd12cbf7 Mon Sep 17 00:00:00 2001 From: Alexandru DAMIAN Date: Tue, 18 Aug 2015 17:28:49 +0100 Subject: bitbake: toaster: checksettings: fix TEMPLATECONF detection Improving the TEMPLATECONF detection by verifying the return code and dumping extra debug information in case of exception. (Bitbake rev: bdc00755993aa37e7669c3859ef4ea9b1fc3e680) Signed-off-by: Alexandru DAMIAN Signed-off-by: Michael Wood Signed-off-by: Richard Purdie --- .../lib/toaster/bldcontrol/management/commands/checksettings.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py') diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py index 2978db23aa..83b4f28c86 100644 --- a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py +++ b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py @@ -166,7 +166,12 @@ class Command(NoArgsCommand): for dirname in self._recursive_list_directories(be.sourcedir,2): if os.path.exists(os.path.join(dirname, ".templateconf")): import subprocess - conffilepath, error = subprocess.Popen('bash -c ". '+os.path.join(dirname, ".templateconf")+'; echo \"\$TEMPLATECONF\""', shell=True, stdout=subprocess.PIPE).communicate() + proc = subprocess.Popen('bash -c ". '+os.path.join(dirname, ".templateconf")+'; echo \"\$TEMPLATECONF\""', shell=True, stdout=subprocess.PIPE) + conffilepath, stderroroutput = proc.communicate() + proc.wait() + if proc.returncode != 0: + raise Exception("Failed to source TEMPLATECONF: %s" % stderroroutput) + conffilepath = os.path.join(conffilepath.strip(), "toasterconf.json") candidatefilepath = os.path.join(dirname, conffilepath) if "toaster_cloned" in candidatefilepath: @@ -195,6 +200,7 @@ class Command(NoArgsCommand): return is_changed except Exception as e: print "Failure while trying to import the toaster config file: %s" % e + traceback.print_exc(e) else: print "\n Toaster could not find a configuration file. You need to configure Toaster manually using the web interface, or create a configuration file and use\n bitbake/lib/toaster/managepy.py loadconf [filename]\n command to load it. You can use https://wiki.yoctoproject.org/wiki/File:Toasterconf.json.txt.patch as a starting point." -- cgit v1.2.3-54-g00ecf