aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Lautrbach <plautrba@redhat.com>2019-02-06 20:43:25 +0100
committerNicolas Iooss <nicolas.iooss@m4x.org>2019-02-10 17:06:09 +0100
commit9b848852a7dbda2d0db3de9eee991de0b9696a1f (patch)
treed85be93aff59ea636ebe593131691454b700d7d9
parent347719d15f61bc2952b2877035e9187e2c6d282f (diff)
downloadandroid_external_selinux-9b848852a7dbda2d0db3de9eee991de0b9696a1f.tar.gz
android_external_selinux-9b848852a7dbda2d0db3de9eee991de0b9696a1f.tar.bz2
android_external_selinux-9b848852a7dbda2d0db3de9eee991de0b9696a1f.zip
python/semanage: Use standard argparse.error() method in handlePermissive
This method prints a usage message including the message to the standard error and terminates the program with a status code of 2. Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
-rw-r--r--python/semanage/semanage4
1 files changed, 1 insertions, 3 deletions
diff --git a/python/semanage/semanage b/python/semanage/semanage
index 6afeac14..4b544bfc 100644
--- a/python/semanage/semanage
+++ b/python/semanage/semanage
@@ -744,9 +744,7 @@ def handlePermissive(args):
if args.action == "delete":
OBJECT.delete(args.type)
else:
- args.parser.print_usage(sys.stderr)
- sys.stderr.write(_('semanage permissive: error: the following argument is required: type\n'))
- sys.exit(1)
+ args.parser.error(message=_('semanage permissive: error: the following argument is required: type\n'))
def setupPermissiveParser(subparsers):