Skip to content

Commit

Permalink
Add messages to let the user know if some plays were skipped, but it'…
Browse files Browse the repository at this point in the history
…s ok. Also, remove the final 'press a key to continue' prompt.
  • Loading branch information
tbielawa committed Sep 29, 2016
1 parent 76f1cd0 commit b03d8cf
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
40 changes: 40 additions & 0 deletions callback_plugins/openshift_quick_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import os
import sys
from ansible import constants as C
from ansible.utils.color import colorize, hostcolor
ANSIBLE_PATH = imp.find_module('ansible')[1]
DEFAULT_PATH = os.path.join(ANSIBLE_PATH, 'plugins/callback/default.py')
DEFAULT_MODULE = imp.load_source(
Expand Down Expand Up @@ -249,3 +250,42 @@ def v2_playbook_on_notify(self, res, handler):
'notify' list attached.
"""
self._display.display("skipping: no hosts matched", color=C.COLOR_SKIP, log_only=True)

def v2_playbook_on_stats(self, stats):
"""Print the final playbook run stats"""
self._display.display("", screen_only=True)
self.banner("PLAY RECAP")

hosts = sorted(stats.processed.keys())
for h in hosts:
t = stats.summarize(h)

self._display.display(
u"%s : %s %s %s %s" % (
hostcolor(h, t),
colorize(u'ok', t['ok'], C.COLOR_OK),
colorize(u'changed', t['changed'], C.COLOR_CHANGED),
colorize(u'unreachable', t['unreachable'], C.COLOR_UNREACHABLE),
colorize(u'failed', t['failures'], C.COLOR_ERROR)),
screen_only=True
)

self._display.display(
u"%s : %s %s %s %s" % (
hostcolor(h, t, False),
colorize(u'ok', t['ok'], None),
colorize(u'changed', t['changed'], None),
colorize(u'unreachable', t['unreachable'], None),
colorize(u'failed', t['failures'], None)),
log_only=True
)

self._display.display("", screen_only=True)
self._display.display("", screen_only=True)

# Some plays are conditional and won't run (such as load
# balancers) if they aren't required. Let the user know about
# this to avoid potential confusion.
if self.plays_total_ran != self.plays_count:
print("Installation Complete: Note: Play count is an estimate and some were skipped because your install does not require them")
self._display.display("", screen_only=True)
1 change: 0 additions & 1 deletion utils/src/ooinstall/cli_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,6 @@ def install(ctx, force, gen_inventory):
http://docs.openshift.com/enterprise/latest/admin_guide/overview.html
"""
click.echo(message)
click.pause()

cli.add_command(install)
cli.add_command(upgrade)
Expand Down

0 comments on commit b03d8cf

Please sign in to comment.