Bug 7251

Summary: Toaster manage.py loadconf traceback when trying to load toasterconf.json
Product: [Build System, Metadata & Runtime] Toaster Reporter: Ionut Chisanovici <ionutx.chisanovici>
Component: toasterAssignee: Alexandru Damian <alexandru.damian>
Status: VERIFIED FIXED QA Contact: Ionut Chisanovici <ionutx.chisanovici>
Severity: normal    
Priority: Medium+ CC: alexandru.damian, belen.barros.pena, bluelightning, bogdanx.a.voiculescu, cristiana.voicu, jessica.zhang
Version: 1.8   
Target Milestone: 1.8 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: New (Never tested)
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ionut Chisanovici 2015-01-26 15:28:21 UTC
Hi,

For master commit: 07f2eca7e9f9163ec48d3a417d8ba885a84762f3, the manage.py loadconf command doesn't work with the toasterconf.json file for the remote use case uploaded on wiki.

Wiki file: https://wiki.yoctoproject.org/wiki/images/d/d5/Toasterconf.json.txt.patch

Steps to reproduce:

1. Clone poky;
2. Start toaster in managed mode: bitbake/bin/toaster
3. If asked to import configuration file from ...meta-yocto/conf/toasterconf.json, do not import it
4. Let toaster managed mode to fully start and then stop it (Ctrl-C)
5. cd bitbake/lib/toaster
6. run command: ./manage.py loadconf /path/to/the/toasterconf_from_wiki.json

Traceback output:

$ ./manage.py loadconf --verbosity=3 --traceback /home/ionut/Downloads/toasterconf.json 
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 222, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 255, in execute
    output = self.handle(*args, **options)
  File "/home/ionut/work/poky_1.8/poky/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py", line 171, in handle
    self._import_layer_config(filepath)
  File "/home/ionut/work/poky_1.8/poky/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py", line 84, in _import_layer_config
    if _get_id_for_sourcetype(lsi['sourcetype']) == LayerSource.TYPE_LAYERINDEX or lsi['apiurl'].startswith("/"):
  File "/home/ionut/work/poky_1.8/poky/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py", line 25, in _get_id_for_sourcetype
    raise Exception("Could not find definition for sourcetype " + s)
TypeError: cannot concatenate 'str' and 'int' objects

Cheers,
Ionut C
Comment 1 Alexandru Damian 2015-01-27 18:01:53 UTC
Pushed for review on 

adamian/20150127-fiz-6785
Comment 2 Alexandru Damian 2015-02-02 11:04:03 UTC
merged in origin/master
Comment 3 Ionut Chisanovici 2015-02-05 16:40:12 UTC
Verified in master, commit: 1f53edeaf9ea59dd55459a6d5a93829fb4983839
Issue is fixed.

Cheers,
Ionut C