[KVM-AUTOTEST PATCH 6/7] KVM test: kvm_config.py: match(): put filter inside parentheses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This solves problems due to operator precedence (such as virtio|e1000 matching
nic_e1000 even though it shouldn't).

Signed-off-by: Michael Goldish <mgoldish@xxxxxxxxxx>
---
 client/tests/kvm/kvm_config.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/client/tests/kvm/kvm_config.py b/client/tests/kvm/kvm_config.py
index 52de4c7..649f2c3 100755
--- a/client/tests/kvm/kvm_config.py
+++ b/client/tests/kvm/kvm_config.py
@@ -83,7 +83,7 @@ class config:
         @param filter: A regular expression that defines the filter.
         @param dict: Dictionary that will be inspected.
         """
-        filter = re.compile(r"(\.|^)" + filter + r"(\.|$)")
+        filter = re.compile(r"(\.|^)(%s)(\.|$)" % filter)
         return bool(filter.search(dict["name"]))
 
 
-- 
1.5.4.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux