Re: [PATCH 2/2] python/semanage: Use standard argparse.error() method in handlePermissive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 6, 2019 at 8:43 PM Petr Lautrbach <plautrba@xxxxxxxxxx> wrote:
>
> 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@xxxxxxxxxx>

For this patch:
Acked-by: Nicolas Iooss <nicolas.iooss@xxxxxxx>

> ---
>  python/semanage/semanage | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/python/semanage/semanage b/python/semanage/semanage
> index 9b737fa8..a9fcb319 100644
> --- a/python/semanage/semanage
> +++ b/python/semanage/semanage
> @@ -743,9 +743,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):
> --
> 2.20.1
>




[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux