From: Alexandru DAMIAN Date: Tue, 18 Aug 2015 16:28:49 +0000 (+0100) Subject: toaster: checksettings: fix TEMPLATECONF detection X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bdc00755993aa37e7669c3859ef4ea9b1fc3e680;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git toaster: checksettings: fix TEMPLATECONF detection Improving the TEMPLATECONF detection by verifying the return code and dumping extra debug information in case of exception. Signed-off-by: Alexandru DAMIAN Signed-off-by: Michael Wood Signed-off-by: Richard Purdie --- diff --git a/lib/toaster/bldcontrol/management/commands/checksettings.py b/lib/toaster/bldcontrol/management/commands/checksettings.py index 2978db23aab..83b4f28c86d 100644 --- a/lib/toaster/bldcontrol/management/commands/checksettings.py +++ b/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."