Coverage for lib/ansible/plugins/callback/osx_say.py : 57%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# (c) 2012, Michael DeHaan, <michael.dehaan@gmail.com> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
callback: osx_say type: notification requirements: - whitelising in configuration - the '/usr/bin/say' command line program (standard on OS X) short_description: oneline Ansible screen output version_added: historical description: - This plugin will use the 'say' program to "speak" about play events. '''
""" makes Ansible much more exciting on OS X. """
super(CallbackModule, self).__init__()
# plugin disable itself if say is not present # ansible will not call any callback if disabled is set to True if not os.path.exists(SAY_CMD): self.disabled = True self._display.warning("%s does not exist, plugin %s disabled" % (SAY_CMD, os.path.basename(__file__)))
subprocess.call([SAY_CMD, msg, "--voice=%s" % (voice)])
self.say("Failure on host %s" % host, FAILED_VOICE)
self.say("pew", LASER_VOICE)
self.say("pew", LASER_VOICE)
self.say("Failure on host %s" % host, FAILED_VOICE)
self.say("pew", LASER_VOICE)
self.say("Failure on host %s" % host, FAILED_VOICE)
self.say("Running Playbook", REGULAR_VOICE)
self.say("pew", LASER_VOICE)
if not is_conditional: self.say("Starting task: %s" % name, REGULAR_VOICE) else: self.say("Notifying task: %s" % name, REGULAR_VOICE)
self.say("Gathering facts", REGULAR_VOICE)
self.say("Starting play: %s" % name, HAPPY_VOICE)
self.say("Play complete", HAPPY_VOICE) |