From: Ján Tomko Date: Wed, 20 Nov 2019 19:10:13 +0000 (+0100) Subject: scripts: use in even more X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e633461bdf012a39b2b9753fe1713748917bb066;p=libvirt.git scripts: use in even more Signed-off-by: Ján Tomko Reviewed-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- diff --git a/scripts/check-aclrules.py b/scripts/check-aclrules.py index dfd5fa4826..5a7d275410 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..d6bf1f8d1f 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("#"): @@ -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) 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