diff mbox series

[04/13] python/sepolicy: drop unused CheckPolicyType

Message ID 20180804194734.12577-5-nicolas.iooss@m4x.org (mailing list archive)
State Not Applicable
Headers show
Series Fix some issues found by flake8 | expand

Commit Message

Nicolas Iooss Aug. 4, 2018, 7:47 p.m. UTC
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>
---
 python/sepolicy/sepolicy.py | 10 ----------
 1 file changed, 10 deletions(-)
diff mbox series

Patch

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):