]> xenbits.xensource.com Git - libvirt.git/commitdiff
scripts: use in even more
authorJán Tomko <jtomko@redhat.com>
Wed, 20 Nov 2019 19:10:13 +0000 (20:10 +0100)
committerJán Tomko <jtomko@redhat.com>
Fri, 22 Nov 2019 10:40:52 +0000 (11:40 +0100)
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
scripts/check-aclrules.py
scripts/check-driverimpls.py
scripts/check-symfile.py
scripts/dtrace2systemtap.py
scripts/genpolkit.py
scripts/gensystemtap.py

index dfd5fa48265c2f7ec88e2e29688af94c68dc1793..5a7d2754107b2d54e22999a02f8e456cdd4920e5 100755 (executable)
@@ -128,7 +128,7 @@ with open(proto, "r") as fh:
                     api = name_to_ProcName(m.group(1))
                     # Event filtering is handled in daemon/remote.c
                     # instead of drivers
-                    if line.find("_EVENT_REGISTER") == -1:
+                    if "_EVENT_REGISTER" not in line:
                         filteredmap[api] = True
                     incomment = False
 
index ca7ec3af7fc99f14726d9d21e22bf8b19185174e..bc3f16a8161a4cc66b8d1b558d26a93a1b63c750 100755 (executable)
@@ -33,7 +33,7 @@ def checkdriverimpls(filename):
         for line in fh:
             lineno = lineno + 1
             if intable:
-                if line.find("}") != -1:
+                if "}" in line:
                     intable = False
                     mainprefix = None
                     continue
index a543a0fbcd5ff862b7aaaa9feb37aae2b69a9e2f..0c025919911887e7fbbbc7117bc073dcaf367fa5 100755 (executable)
@@ -36,9 +36,9 @@ ret = 0
 with open(symfile, "r") as fh:
     for line in fh:
         line = line.strip()
-        if line.find("{") != -1:
+        if "{" in line:
             continue
-        if line.find("}") != -1:
+        if "}" in line:
             continue
         if line in ["global:", "local:"]:
             continue
@@ -46,7 +46,7 @@ with open(symfile, "r") as fh:
             continue
         if line[0] == '#':
             continue
-        if line.find("*") != -1:
+        if "*" in line:
             continue
 
         line = line.strip(";")
index 922713e599f44565031407a2582f78ec6f370c6e..d6bf1f8d1fe766c658805d8c4c8f0b0d663ed968 100755 (executable)
@@ -49,9 +49,9 @@ with open(dtrace, "r") as fh:
         line = line.strip()
         if line == "":
             continue
-        if line.find("provider ") != -1 and line.find("{") != -1:
+        if "provider " in line and "{" in line:
             continue
-        if line.find("};") != -1:
+        if "};" in line:
             continue
 
         if line.startswith("#"):
@@ -126,7 +126,7 @@ for file in filelist:
         for idx in range(len(argbits)):
             arg = argbits[idx]
             isstr = False
-            if arg.find("char *") != -1:
+            if 'char *' in arg:
                 isstr = True
 
             m = re.search(r'''^.*\s\*?(\S+)$''', arg)
index 0cdba2bd3c700a3570acb74d1a75e4afe6f9396c..230d920f705a467afc004fa5bd97355d9fe267ca 100755 (executable)
@@ -55,13 +55,13 @@ aclfile = sys.argv[1]
 with open(aclfile, "r") as fh:
     for line in fh:
         if in_opts:
-            if line.find("*/") != -1:
+            if "*/" in line:
                 in_opts = False
             else:
                 m = re.search(r'''\*\s*\@(\w+):\s*(.*?)\s*$''', line)
                 if m is not None:
                     opts[m.group(1)] = m.group(2)
-        elif line.find("**") != -1:
+        elif "**" in line:
             in_opts = True
         else:
             m = re.search(r'''VIR_ACCESS_PERM_(%s)_((?:\w|_)+),''' %
index c4bc1620d0ab31805d2abbada97d762a1fd3efb1..7b391cc91130b504f61a17cd6b44a3409fcdfc74 100755 (executable)
@@ -46,7 +46,7 @@ def load_file(fh):
             instatus = True
         elif re.search(r'''enum remote_auth_type''', line):
             inauth = True
-        elif line.find("}") != -1:
+        elif "}" in line:
             intype = False
             instatus = False
             inauth = False