mirror of
https://github.com/SELinuxProject/selinux
synced 2025-04-10 11:41:48 +00:00
python/sepolicy: drop unused CheckPolicyType
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@m4x.org>
This commit is contained in:
parent
a0c167ed22
commit
1fb0c7790c
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user