CheckPolicyType class is not used in sepolicy and has been written from an buggy copy-paste: "newval.append(v)" does not make any sense in CheckPolicyType.__call__, as reported by flake8: python/sepolicy/sepolicy.py:190:13: F821 undefined name 'newval' python/sepolicy/sepolicy.py:190:27: F821 undefined name 'v' Signed-off-by: Nicolas Iooss <nicolas.iooss@xxxxxxx> --- python/sepolicy/sepolicy.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/python/sepolicy/sepolicy.py b/python/sepolicy/sepolicy.py index 141f64ecd15f..24631b51ee37 100755 --- a/python/sepolicy/sepolicy.py +++ b/python/sepolicy/sepolicy.py @@ -181,16 +181,6 @@ class LoadPolicy(argparse.Action): setattr(namespace, self.dest, values) -class CheckPolicyType(argparse.Action): - - def __call__(self, parser, namespace, values, option_string=None): - from sepolicy.generate import get_poltype_desc, poltype - if values not in poltype.keys(): - raise ValueError("%s invalid SELinux policy type\n%s" % (values, get_poltype_desc())) - newval.append(v) - setattr(namespace, self.dest, values) - - class CheckUser(argparse.Action): def __call__(self, parser, namespace, value, option_string=None): -- 2.18.0 _______________________________________________ Selinux mailing list Selinux@xxxxxxxxxxxxx To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx. To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.