Skip to contentSkip to conversation

sanity.bbclass: fix AttributeError in mirror format checks

PATCH Superseded Mikko Ylinen 2 participants 2 messages Jun 30, 2017 – Jul 3, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sanity.bbclass: fix AttributeError in mirror format checks

mirrors is a list after split() and results in:

AttributeError: 'list' object has no attribute 'strip'

when the 'mirror values are pairs' check fails.

---
 meta/classes/sanity.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/sanity.bbclass +1 -1
index e8064ac483..1f74026e13 100644
@@ -839,7 +839,7 @@ def check_sanity_everybuild(status, d):
 
         # Split into pairs
         if len(mirrors) % 2 != 0:
-            bb.warn('Invalid mirror variable value for %s: %s, should contain paired members.' % (mirror_var, mirrors.strip()))
+            bb.warn('Invalid mirror variable value for %s: %s, should contain paired members.' % (mirror_var, str(mirrors).strip()))
             continue
         mirrors = list(zip(*[iter(mirrors)]*2))
 
Signature · 1 line
2.11.0
#1 lore raw
Quoted 16 lines · Mikko Ylinen

mirrors is a list after split() and results in:

AttributeError: 'list' object has no attribute 'strip'

when the 'mirror values are pairs' check fails.

---
 meta/classes/sanity.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/sanity.bbclass +0 -0
index e8064ac483..1f74026e13 100644

meta/classes/sanity.bbclass def check_sanity_everybuild(status, d): · line 842

Quoted 5 lines
meta/classes/sanity.bbclass +1 -1
@@ -839,7 +839,7 @@ def check_sanity_everybuild(status, d):
 
         # Split into pairs
         if len(mirrors) % 2 != 0:
-            bb.warn('Invalid mirror variable value for %s: %s, should contain paired members.' % (mirror_var, mirrors.strip()))
+            bb.warn('Invalid mirror variable value for %s: %s, should contain paired members.' % (mirror_var, str(mirrors).strip()))

.strip() is redundant here, because str(mirrors) will produce [...], i.e. the string will never have leading or trailing spaces.

Signature · 6 lines
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.