From: Frantisek Sumsal Date: Fri, 27 May 2022 09:45:15 +0000 (+0200) Subject: test: fix a couple of pylint warnings X-Git-Tag: v252-rc1~920^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=47a00df1f0700e471adb96b1ec80b05f56c8032d;p=thirdparty%2Fsystemd.git test: fix a couple of pylint warnings --- diff --git a/test/test-shutdown.py b/test/test-shutdown.py index 1a91753b87a..77ac3a7d9fb 100755 --- a/test/test-shutdown.py +++ b/test/test-shutdown.py @@ -4,9 +4,10 @@ import argparse import logging -import pexpect import sys +import pexpect + def run(args): @@ -21,7 +22,7 @@ def run(args): if args.verbose: console.logfile = sys.stdout - logger.debug("child pid %d" % console.pid) + logger.debug("child pid %d", console.pid) try: logger.info("waiting for login prompt") @@ -88,13 +89,12 @@ def run(args): ret = 0 except Exception as e: logger.error(e) - logger.info("killing child pid %d" % console.pid) + logger.info("killing child pid %d", console.pid) console.terminate() return ret - -if __name__ == '__main__': +def main(): parser = argparse.ArgumentParser(description='test logind shutdown feature') parser.add_argument("-v", "--verbose", action="store_true", help="verbose") parser.add_argument("command", help="command to run") @@ -109,6 +109,9 @@ if __name__ == '__main__': logging.basicConfig(level=level) - sys.exit(run(args)) + return run(args) + +if __name__ == '__main__': + sys.exit(main()) # vim: sw=4 et