Skip to content
This repository has been archived by the owner on Dec 28, 2024. It is now read-only.

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
spencergibb committed Mar 18, 2014
2 parents 6364384 + 01ff6ac commit ac01ff5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/battleschool/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '0.3.0'
__version__ = '0.3.1'
__author__ = 'Spencer Gibb'
17 changes: 12 additions & 5 deletions lib/battleschool/printing.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,20 @@ class BattleschoolRunnerCallbacks(DefaultRunnerCallbacks):
""" callbacks for use by battles """

def get_play(self):
if self.runner:
return self.runner
if self.task:
return self.task
return self.play

def get_name(self):
if self.runner:
return self.get_play().module_name
return self.get_play().name

def on_failed(self, host, res, ignore_errors=False):
if not ignore_errors:
display("\tTask FAILED: %s %s" % (self.get_play().name, res['msg']), color="red")
display("\tTask FAILED: %s %s" % (self.get_name(), res['msg']), color="red")
super(BattleschoolRunnerCallbacks, self).on_failed(host, res, ignore_errors=ignore_errors)

def on_ok(self, host, res):
Expand All @@ -92,7 +99,7 @@ def on_ok(self, host, res):

try:
if self.get_play():
display("\tTask OK: %s%s" % (self.get_play().name, msg))
display("\tTask OK: %s%s" % (self.get_name(), msg))
except AttributeError:
invocation = res['invocation']
msg = invocation['module_args']
Expand Down Expand Up @@ -122,15 +129,15 @@ def on_unreachable(self, host, results):
super(BattleschoolRunnerCallbacks, self).on_unreachable(host, results)

def on_skipped(self, host, item=None):
display("\tTask skipped: %s" % self.get_play().name, color="yellow")
display("\tTask skipped: %s" % self.get_name(), color="yellow")
super(BattleschoolRunnerCallbacks, self).on_skipped(host, item)

def on_error(self, host, err):
display("\tTask ERROR: %s%s" % (self.get_play().name, err), color="red")
display("\tTask ERROR: %s%s" % (self.get_name(), err), color="red")
super(BattleschoolRunnerCallbacks, self).on_error(host, err)

def on_no_hosts(self):
display("\tTask NO HOSTS: %s" % self.get_play().name, color="red")
display("\tTask NO HOSTS: %s" % self.get_name(), color="red")
super(BattleschoolRunnerCallbacks, self).on_no_hosts()

def on_async_poll(self, host, res, jid, clock):
Expand Down
2 changes: 1 addition & 1 deletion lib/battleschool/source/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ def module_args(self, source):
update = "yes"
force = "yes"

module_args = "repo=%s dest=%s force=%s update=%s" % \
module_args = "repo=%s dest=%s force=%s update=%s " % \
(source['repo'], self.dest_dir(source), force, update)
return module_args
2 changes: 1 addition & 1 deletion lib/battleschool/source/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def module_args(self, source):
if self.options.update_sources:
force = "yes"

module_args = "url=%s dest=%s/%s force=%s" % \
module_args = "url=%s dest=%s/%s force=%s validate_certs=no " % \
(source["url"], self.dest_dir(source), source["name"], force)

if "playbooks" not in source:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from battleschool.constants import DIST_MODULE_PATH

long_description = """
Development environment provisioning using ansible (http://www.ansibleworks.com/docs/),
Development environment provisioning using ansible (http://docs.ansible.com),
ala boxen (http://boxen.github.com/) which uses puppet (http://puppetlabs.com/puppet/what-is-puppet) and
kitchenplan (https://github.com/kitchenplan/kitchenplan) which uses chef (http://docs.opscode.com/)
Built on and for macs, but should be usable on Linux
Expand Down

0 comments on commit ac01ff5

Please sign in to comment.