Bug 7251 - Toaster manage.py loadconf traceback when trying to load toasterconf.json
Summary: Toaster manage.py loadconf traceback when trying to load toasterconf.json
Status: VERIFIED FIXED
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: 1.8
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 1.8 M3
Assignee: Alexandru Damian
QA Contact: Ionut Chisanovici
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-01-26 15:28 UTC by Ionut Chisanovici
Modified: 2015-02-11 13:30 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: New (Never tested)
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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