Skip to contentSkip to conversation

bitbake: cooker: convert type which needs to be marshalled

PATCH Superseded Sujith Haridasan 2 participants 3 messages Nov 29, 2016

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover bitbake: cooker: convert type which needs to be marshalled

From: Sujith H <[email protected]>

While working on toaster, I found that when data returned from getAllKeysWithFlags was causing problem. So after debugging I found that one of the variable was having a data type which couldn't be marshalled by xmlrpc. So this patch helps us to make the data of type string.

The following changes since commit 71b7c3a88ec5a20d5e4531751d0bf23d5c94e494:

Revert "classes/populate_sdk_ext: require uninative" (2016-11-28 15:49:15 +0000)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib sujith/xmlrpc-cooker-fix
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=sujith/xmlrpc-cooker-fix

Sujith H (1):
bitbake: cooker: convert type which needs to be marshalled

 bitbake/lib/bb/cooker.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 bitbake: cooker: convert type which needs to be marshalled

From: Sujith H <[email protected]>

We assume that the value taken by variable v can be string, integer or any type which can be marshalled by xmlrpc. This change would help us to convert the non marshallable types to string. So that we don't get exception from xmlrpc.

[YOCTO #10740]

---
 bitbake/lib/bb/cooker.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bitbake/lib/bb/cooker.py +1 -1
index c08af45..1dab450 100644
@@ -1488,7 +1488,7 @@ class BBCooker:
                 v = self.data.getVar(k, expand)
                 if not k.startswith("__") and not isinstance(v, bb.data_smart.DataSmart):
                     dump[k] = {
-    'v' : v ,
+    'v' : repr(v) ,
     'history' : self.data.varhistory.variable(k),
                     }
                     for d in flaglist:
Signature · 1 line
1.9.1
#2 lore raw
Quoted 24 lines · Sujith Haridasan

From: Sujith H <[email protected]>

We assume that the value taken by variable v can be string, integer or any type which can be marshalled by xmlrpc. This change would help us to convert the non marshallable types to string. So that we don't get exception from xmlrpc.

[YOCTO #10740]

---
 bitbake/lib/bb/cooker.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bitbake/lib/bb/cooker.py +0 -0
index c08af45..1dab450 100644
@@ -1488,7 +1488,7 @@ class BBCooker:
                 v = self.data.getVar(k, expand)
                 if not k.startswith("__") and not isinstance(v,

bb.data_smart.DataSmart):

                     dump[k] = {

bitbake/lib/bb/cooker.py class BBCooker: · line 1494

Quoted 5 lines
bitbake/lib/bb/cooker.py +1 -1
-    'v' : v ,
+    'v' : repr(v) ,
     'history' : self.data.varhistory.variable(k),
                     }
                     for d in flaglist:

I think str(v) would be more appropriate here. We need it to be a string, not necessarily a more complete representation of the object.

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics