give a warning when no roles match the search instead of returning rc 1 (#79195)

* give a warning when no roles match the search instead of returning rc 1

* porting guide note

* Update docs/docsite/rst/porting_guides/porting_guide_core_2.15.rst

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
pull/79211/head
Sloane Hertel 2 years ago committed by GitHub
parent f3f7d44238
commit da3a7618ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,4 @@
bugfixes:
- >-
``ansible-galaxy search rolename`` - give a warning instead of non-zero return code when search results are empty.
This is similar to the behavior when listing roles, which gives a warning if a role cannot be found and exits with a return code of ``0``.

@ -25,7 +25,7 @@ No notable changes
Command Line
============
No notable changes
* The return code of ``ansible-galaxy search`` is now 0 instead of 1 and the stdout is empty when results are empty to align with other ``ansible-galaxy`` commands.
Deprecated

@ -1721,8 +1721,8 @@ class GalaxyCLI(CLI):
tags=context.CLIARGS['galaxy_tags'], author=context.CLIARGS['author'], page_size=page_size)
if response['count'] == 0:
display.display("No roles match your search.", color=C.COLOR_ERROR)
return 1
display.warning("No roles match your search.")
return 0
data = [u'']

Loading…
Cancel
Save