Re: [libvirt] [PATCH 4/3] scripts: use in even more

2019-11-22 Thread Erik Skultety
On Wed, Nov 20, 2019 at 08:16:27PM +0100, Ján Tomko wrote:
> Signed-off-by: Ján Tomko 
> ---
>  scripts/check-aclrules.py| 2 +-
>  scripts/check-driverimpls.py | 2 +-
>  scripts/check-symfile.py | 6 +++---
>  scripts/dtrace2systemtap.py  | 4 ++--
>  scripts/genpolkit.py | 4 ++--
>  scripts/gensystemtap.py  | 2 +-
>  6 files changed, 10 insertions(+), 10 deletions(-)
>

With the following squashed in:
diff --git a/scripts/dtrace2systemtap.py b/scripts/dtrace2systemtap.py
index cf4d8e1a79..d6bf1f8d1f 100755
--- a/scripts/dtrace2systemtap.py
+++ b/scripts/dtrace2systemtap.py
@@ -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)


Reviewed-by: Erik Skultety 

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 4/3] scripts: use in even more

2019-11-20 Thread Ján Tomko
Signed-off-by: Ján Tomko 
---
 scripts/check-aclrules.py| 2 +-
 scripts/check-driverimpls.py | 2 +-
 scripts/check-symfile.py | 6 +++---
 scripts/dtrace2systemtap.py  | 4 ++--
 scripts/genpolkit.py | 4 ++--
 scripts/gensystemtap.py  | 2 +-
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/scripts/check-aclrules.py b/scripts/check-aclrules.py
index 40c47c1c6b..1a76ebcb3b 100755
--- a/scripts/check-aclrules.py
+++ b/scripts/check-aclrules.py
@@ -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
 
diff --git a/scripts/check-driverimpls.py b/scripts/check-driverimpls.py
index ca7ec3af7f..bc3f16a816 100755
--- a/scripts/check-driverimpls.py
+++ b/scripts/check-driverimpls.py
@@ -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
diff --git a/scripts/check-symfile.py b/scripts/check-symfile.py
index a543a0fbcd..0c02591991 100755
--- a/scripts/check-symfile.py
+++ b/scripts/check-symfile.py
@@ -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(";")
diff --git a/scripts/dtrace2systemtap.py b/scripts/dtrace2systemtap.py
index 922713e599..cf4d8e1a79 100755
--- a/scripts/dtrace2systemtap.py
+++ b/scripts/dtrace2systemtap.py
@@ -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("#"):
diff --git a/scripts/genpolkit.py b/scripts/genpolkit.py
index 0cdba2bd3c..230d920f70 100755
--- a/scripts/genpolkit.py
+++ b/scripts/genpolkit.py
@@ -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|_)+),''' %
diff --git a/scripts/gensystemtap.py b/scripts/gensystemtap.py
index c4bc1620d0..7b391cc911 100755
--- a/scripts/gensystemtap.py
+++ b/scripts/gensystemtap.py
@@ -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
-- 
2.19.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list