match rpm pattern with regexp
Barış Metin [Tue, 11 May 2010 20:02:10 +0000 (20:02 +0000)]
web/MonitorWeb/monitorweb/controllers.py

index 3d68fe6..149a397 100644 (file)
@@ -350,7 +350,8 @@ class Root(controllers.RootController, MonitorXmlrpcServer):
                                if 'rpmvalue' in data and 'rpms' in data:
                                        if agg['rpms']:
                                                rpm_list = agg['rpms'].split()
-                                               rpm_list = filter(lambda x: data['rpmvalue'] in x, rpm_list)
+                                               rpm_list = filter(lambda x: re.match(data['rpmvalue'], x, re.I),
+                                                                  rpm_list)
                                                agg['rpms'] = " ".join(rpm_list)
 
                                query.append(agg)