Skip to contentSkip to conversation

michaelw/toastertable/sorting-cache-hit

review-request Michael Wood 2 participants 3 messages Jul 14, 2015 – Jul 28, 2015

lore
Share & tools
lore
#0 lore raw

poky-contrib branch: michaelw/toastertable/sorting-cache-hit

commit 548636b2c9a7be82bc098596c4e08ab156863e5b

Author: Michael Wood <[email protected]>
Date:   Tue Jul 14 17:42:56 2015 +0100

bitbake: toastergui: Toastertables don't replace dash in cache key

The dash character was being stripped from the cache key when we
sanitise
it for the memcache backend. This meant that we were getting a
false hit
on the cache and returning non descending results which are
indicated by
the dash prefix on the field name.

bitbake/lib/toaster/toastergui/widgets.py +2 -2
index 5f6b47b..0885402 100644
@@ -252,8 +252,8 @@ class ToasterTable(TemplateView):
         for key, val in kwargs.iteritems():
             cache_name = cache_name + str(key) + str(val)
 
-        # No special chars allowed in the cache name
-        cache_name = re.sub(r'[^A-Za-z0-9]', "", cache_name)
+        # No special chars allowed in the cache name apart from dash
+        cache_name = re.sub(r'[^A-Za-z0-9-]', "", cache_name)
         data = cache.get(cache_name)
 
         if data:
#1 lore raw

Seems fine to me.

Quoted 42 lines · Michael Wood

poky-contrib branch: michaelw/toastertable/sorting-cache-hit

commit 548636b2c9a7be82bc098596c4e08ab156863e5b

Author: Michael Wood <[email protected]>
Date:   Tue Jul 14 17:42:56 2015 +0100

bitbake: toastergui: Toastertables don't replace dash in cache key

The dash character was being stripped from the cache key when we
sanitise
it for the memcache backend. This meant that we were getting a false
hit
on the cache and returning non descending results which are indicated
by
the dash prefix on the field name.

bitbake/lib/toaster/toastergui/widgets.py +2 -3
index 5f6b47b..0885402 100644
@@ -252,8 +252,8 @@ class ToasterTable(TemplateView):
         for key, val in kwargs.iteritems():
             cache_name = cache_name + str(key) + str(val)
 
-        # No special chars allowed in the cache name
-        cache_name = re.sub(r'[^A-Za-z0-9]', "", cache_name)
+        # No special chars allowed in the cache name apart from dash
+        cache_name = re.sub(r'[^A-Za-z0-9-]', "", cache_name)
         data = cache.get(cache_name)
 
         if data:
 
--

_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster

Signature · 3 lines
Alex Damian
Yocto Project
SSG / OTC
#2 lore raw

Taken for submission,

Alex

Quoted 56 lines · Alexandru

Seems fine to me.

Quoted 37 lines · Michael Wood

poky-contrib branch: michaelw/toastertable/sorting-cache-hit

commit 548636b2c9a7be82bc098596c4e08ab156863e5b

Author: Michael Wood <[email protected]>
Date:   Tue Jul 14 17:42:56 2015 +0100

bitbake: toastergui: Toastertables don't replace dash in cache key

The dash character was being stripped from the cache key when we
sanitise
it for the memcache backend. This meant that we were getting a false
hit
on the cache and returning non descending results which are indicated
by
the dash prefix on the field name.

bitbake/lib/toaster/toastergui/widgets.py +2 -3
index 5f6b47b..0885402 100644
@@ -252,8 +252,8 @@ class ToasterTable(TemplateView):
         for key, val in kwargs.iteritems():
             cache_name = cache_name + str(key) + str(val)
 
-        # No special chars allowed in the cache name
-        cache_name = re.sub(r'[^A-Za-z0-9]', "", cache_name)
+        # No special chars allowed in the cache name apart from dash
+        cache_name = re.sub(r'[^A-Za-z0-9-]', "", cache_name)
         data = cache.get(cache_name)
 
         if data:
 
--
Quoted 5 lines

_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster

--
Alex Damian
Yocto Project
SSG / OTC

Signature · 3 lines
Alex Damian
Yocto Project
SSG / OTC