mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
test/zdtm: avoid overwriting superclass attributes in userns_flavor
Pass name and uns as parameters to ns_flavor.__init__() instead of overwriting them after the super constructor sets them. This avoids the attribute-overwrite pattern flagged by CodeQL while keeping the same behavior. Assisted-by: Claude Code (claude-opus-4-6) Signed-off-by: Adrian Reber <areber@redhat.com>
This commit is contained in:
parent
afea0d7a05
commit
dfea64c759
1 changed files with 4 additions and 6 deletions
10
test/zdtm.py
10
test/zdtm.py
|
|
@ -222,10 +222,10 @@ class ns_flavor:
|
|||
]
|
||||
__dev_dirs = ["pts", "net"]
|
||||
|
||||
def __init__(self, opts):
|
||||
self.name = "ns"
|
||||
def __init__(self, opts, name="ns", uns=False):
|
||||
self.name = name
|
||||
self.ns = True
|
||||
self.uns = False
|
||||
self.uns = uns
|
||||
self.root, self.devpath = make_tests_root()
|
||||
self.root_mounted = False
|
||||
|
||||
|
|
@ -357,9 +357,7 @@ class ns_flavor:
|
|||
|
||||
class userns_flavor(ns_flavor):
|
||||
def __init__(self, opts):
|
||||
ns_flavor.__init__(self, opts)
|
||||
self.name = "userns"
|
||||
self.uns = True
|
||||
ns_flavor.__init__(self, opts, name="userns", uns=True)
|
||||
|
||||
def init(self, l_bins, x_bins):
|
||||
# To be able to create roots_yard in CRIU
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue