1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-09 01:18:19 +03:00

test: fix a couple of pylint warnings

This commit is contained in:
Frantisek Sumsal 2022-05-27 11:45:15 +02:00
parent 3e624bb13b
commit 47a00df1f0

View File

@ -4,9 +4,10 @@
import argparse import argparse
import logging import logging
import pexpect
import sys import sys
import pexpect
def run(args): def run(args):
@ -21,7 +22,7 @@ def run(args):
if args.verbose: if args.verbose:
console.logfile = sys.stdout console.logfile = sys.stdout
logger.debug("child pid %d" % console.pid) logger.debug("child pid %d", console.pid)
try: try:
logger.info("waiting for login prompt") logger.info("waiting for login prompt")
@ -88,13 +89,12 @@ def run(args):
ret = 0 ret = 0
except Exception as e: except Exception as e:
logger.error(e) logger.error(e)
logger.info("killing child pid %d" % console.pid) logger.info("killing child pid %d", console.pid)
console.terminate() console.terminate()
return ret return ret
def main():
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='test logind shutdown feature') parser = argparse.ArgumentParser(description='test logind shutdown feature')
parser.add_argument("-v", "--verbose", action="store_true", help="verbose") parser.add_argument("-v", "--verbose", action="store_true", help="verbose")
parser.add_argument("command", help="command to run") parser.add_argument("command", help="command to run")
@ -109,6 +109,9 @@ if __name__ == '__main__':
logging.basicConfig(level=level) logging.basicConfig(level=level)
sys.exit(run(args)) return run(args)
if __name__ == '__main__':
sys.exit(main())
# vim: sw=4 et # vim: sw=4 et