malcontent-client: Implement --quiet for check subcommand
When run with `--quiet`, the `check` subcommand will now print nothing. It continues to exit with an appropriate exit status. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
parent
af44861281
commit
b14fa7b056
|
@ -216,12 +216,14 @@ def command_check(user, path, quiet=False, interactive=True):
|
||||||
noun = 'Path'
|
noun = 'Path'
|
||||||
|
|
||||||
if is_allowed:
|
if is_allowed:
|
||||||
print('{} {} is allowed by app filter for user {}'.format(
|
if not quiet:
|
||||||
noun, path, user_id))
|
print('{} {} is allowed by app filter for user {}'.format(
|
||||||
|
noun, path, user_id))
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
print('{} {} is not allowed by app filter for user {}'.format(
|
if not quiet:
|
||||||
noun, path, user_id))
|
print('{} {} is not allowed by app filter for user {}'.format(
|
||||||
|
noun, path, user_id))
|
||||||
raise SystemExit(EXIT_PATH_NOT_ALLOWED)
|
raise SystemExit(EXIT_PATH_NOT_ALLOWED)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue