[12/12] semanage: Print usage when no args
diff mbox

Message ID 1470335645-24224-13-git-send-email-jason@perfinion.com
State Not Applicable
Headers show

Commit Message

Jason Zaman Aug. 4, 2016, 6:34 p.m. UTC
https://bugs.python.org/issue16308

Traceback (most recent call last):
  File "semanage", line 932, in <module>
    do_parser()
  File "semanage", line 911, in do_parser
    args.func(args)
AttributeError: 'Namespace' object has no attribute 'func'
---
 policycoreutils/semanage/semanage | 1 +
 1 file changed, 1 insertion(+)

Patch
diff mbox

diff --git a/policycoreutils/semanage/semanage b/policycoreutils/semanage/semanage
index d945243..5d783b1 100644
--- a/policycoreutils/semanage/semanage
+++ b/policycoreutils/semanage/semanage
@@ -856,6 +856,7 @@  def createCommandParser():
 
     #To add a new subcommand define the parser for it in a function above and call it here.
     subparsers = commandParser.add_subparsers(dest='subcommand')
+    subparsers.required = True
     setupImportParser(subparsers)
     setupExportParser(subparsers)
     setupLoginParser(subparsers)