Bug 7276

Summary: Toaster crash/traceback importing layer configuration
Product: [Build System, Metadata & Runtime] Toaster Reporter: Christopher Larson <kergoth>
Component: toasterAssignee: Alexandru Damian <alexandru.damian>
Status: VERIFIED FIXED QA Contact: Mihail Stanciu <stanciux.mihail>
Severity: normal    
Priority: Medium+ CC: alexandru.c.georgescu, alexandru.damian, belen.barros.pena, bluelightning, cristiana.voicu, jessica.zhang
Version: unspecified   
Target Milestone: 1.8 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Christopher Larson 2015-02-03 16:13:58 UTC
File "/scratch/cedar/toaster-test/poky/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py", line 71, in _import_layer_config
    bvo.giturl = _read_git_url_from_local_repository(bvi['giturl'])
  File "/scratch/cedar/toaster-test/poky/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py", line 62, in _read_git_url_from_local_repository
    raise Exception("Error while looking for remote \"%s\" in \"s\"" % (remote_name, lo.local_path))
NameError: free variable 'lo' referenced before assignment in enclosing scope
Comment 1 Alexandru Damian 2015-02-03 17:04:44 UTC
There seems to be an issue trying to figure out remotes from the local git repo, and it fails to raise the proper exception.

The patch below enables the correct Exception message, which should help debug what is wrong in the first place.


diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py b/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
index e2f61e4..9163e9b 100644
--- a/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
+++ b/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
@@ -59,7 +59,7 @@ class Command(BaseCommand):
                 except ValueError:
                     pass
             if url == None:
-                raise Exception("Error while looking for remote \"%s\" in \"s\"" % (remote_name, lo.local_path))
+                raise Exception("Error while looking for remote \"%s\" in \"%s\"" % (remote_name, out))
             return url
Comment 2 Alexandru Damian 2015-02-05 12:14:54 UTC
Pushed for review on 

poky-contrib:adamian/20150204-bug-7283
Comment 3 Alexandru Damian 2015-02-11 11:48:24 UTC
Merged in master.
Comment 4 Mihail Stanciu 2015-04-10 08:31:50 UTC
Verified on master: 33558eacc8a2d3dce3396b9ab2fd0773ac5076bc