diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2015-12-02 10:02:51 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-12-07 17:37:10 +0000 |
commit | 57e5f24e57caf40007459015bb47801561c779ce (patch) | |
tree | 51512c1728db73ec06612f80cff4ad9ca90b89ea /bitbake/lib/bb/ui | |
parent | 4c1e5ec29ace325d03a5a1386e384201a00f15cf (diff) | |
download | poky-57e5f24e57caf40007459015bb47801561c779ce.tar.gz |
bitbake: toaster: do not create duplicate HelpText objects
buildinfohelper code expects only one HelpText object per
build/variable/description.
Current code creates more than one such an object, which causes
toastergui to crash with this exception:
MultipleObjectsReturned: get() returned more than one HelpText -- it returned 2!
Used git_or_create API to ensure that only one HelpText object is
created.
(Bitbake rev: e9b46803eb6f1f4044919abf90c8aeb3536e73ed)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui')
-rw-r--r-- | bitbake/lib/bb/ui/buildinfohelper.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index 43c243e827..2b9302d108 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py | |||
@@ -700,7 +700,6 @@ class ORMWrapper(object): | |||
700 | def save_build_variables(self, build_obj, vardump): | 700 | def save_build_variables(self, build_obj, vardump): |
701 | assert isinstance(build_obj, Build) | 701 | assert isinstance(build_obj, Build) |
702 | 702 | ||
703 | helptext_objects = [] | ||
704 | for k in vardump: | 703 | for k in vardump: |
705 | desc = vardump[k]['doc'] | 704 | desc = vardump[k]['doc'] |
706 | if desc is None: | 705 | if desc is None: |
@@ -711,10 +710,9 @@ class ORMWrapper(object): | |||
711 | if desc is None: | 710 | if desc is None: |
712 | desc = '' | 711 | desc = '' |
713 | if len(desc): | 712 | if len(desc): |
714 | helptext_objects.append(HelpText(build=build_obj, | 713 | HelpText.objects.get_or_create(build=build_obj, |
715 | area=HelpText.VARIABLE, | 714 | area=HelpText.VARIABLE, |
716 | key=k, | 715 | key=k, text=desc) |
717 | text=desc)) | ||
718 | if not bool(vardump[k]['func']): | 716 | if not bool(vardump[k]['func']): |
719 | value = vardump[k]['v'] | 717 | value = vardump[k]['v'] |
720 | if value is None: | 718 | if value is None: |
@@ -734,8 +732,6 @@ class ORMWrapper(object): | |||
734 | if len(varhist_objects): | 732 | if len(varhist_objects): |
735 | VariableHistory.objects.bulk_create(varhist_objects) | 733 | VariableHistory.objects.bulk_create(varhist_objects) |
736 | 734 | ||
737 | HelpText.objects.bulk_create(helptext_objects) | ||
738 | |||
739 | 735 | ||
740 | class MockEvent(object): | 736 | class MockEvent(object): |
741 | """ This object is used to create event, for which normal event-processing methods can | 737 | """ This object is used to create event, for which normal event-processing methods can |