scripts: run lint also on criu-ns

Signed-off-by: Adrian Reber <areber@redhat.com>
This commit is contained in:
Adrian Reber 2021-07-05 07:19:18 +00:00 committed by Andrei Vagin
parent bd648cc8d9
commit 8f2b8c7be0
2 changed files with 5 additions and 4 deletions

View file

@ -406,6 +406,7 @@ lint:
flake8 --config=scripts/flake8.cfg test/inhfd/*.py
flake8 --config=scripts/flake8.cfg test/others/rpc/config_file.py
flake8 --config=scripts/flake8.cfg lib/py/images/pb2dict.py
flake8 --config=scripts/flake8.cfg scripts/criu-ns
shellcheck --version
shellcheck scripts/*.sh
shellcheck scripts/ci/*.sh scripts/ci/apt-install

View file

@ -52,7 +52,7 @@ def _mount_new_proc():
"""
Mount new /proc filesystem.
"""
if _mount(None, b"/", None, MS_SLAVE|MS_REC, None):
if _mount(None, b"/", None, MS_SLAVE | MS_REC, None):
_errno = ctypes.get_errno()
raise OSError(_errno, errno.errorcode[_errno])
if _mount(b'proc', b'/proc', b'proc', 0, None):
@ -144,10 +144,10 @@ def set_pidns(tpid, pid_idx):
"""
ns_fd = os.open('/proc/%s/ns/pid' % tpid, os.O_RDONLY)
if is_my_namespace(ns_fd):
for l in open('/proc/%s/status' % tpid):
if not l.startswith('NSpid:'):
for line in open('/proc/%s/status' % tpid):
if not line.startswith('NSpid:'):
continue
ls = l.split()
ls = line.split()
if ls[1] != tpid:
os.close(ns_fd)
raise OSError(errno.ESRCH, 'No such pid')