diff --git a/v2/ansible/executor/playbook_executor.py b/v2/ansible/executor/playbook_executor.py index 94bdbf01e1f..ad9570963aa 100644 --- a/v2/ansible/executor/playbook_executor.py +++ b/v2/ansible/executor/playbook_executor.py @@ -127,6 +127,7 @@ class PlaybookExecutor: if entry: entrylist.append(entry) # per playbook + self._display.vvvvv('%d plays in %s' % (i, playbook_path)) if entrylist: return entrylist diff --git a/v2/ansible/utils/display.py b/v2/ansible/utils/display.py index dd44d61dd30..62dbeabca51 100644 --- a/v2/ansible/utils/display.py +++ b/v2/ansible/utils/display.py @@ -26,11 +26,9 @@ from ansible.utils.color import stringc class Display: - def __init__(self, conn_info=None): - if conn_info: - self._verbosity = conn_info.verbosity - else: - self._verbosity = 0 + def __init__(self, verbosity=0): + + self.verbosity = verbosity # list of all deprecation messages to prevent duplicate display self._deprecations = {} @@ -70,10 +68,13 @@ class Display: def vvvv(self, msg, host=None): return self.verbose(msg, host=host, caplevel=3) + def vvvvv(self, msg, host=None): + return self.verbose(msg, host=host, caplevel=4) + def verbose(self, msg, host=None, caplevel=2): # FIXME: this needs to be implemented #msg = utils.sanitize_output(msg) - if self._verbosity > caplevel: + if self.verbosity > caplevel: if host is None: self.display(msg, color='blue') else: @@ -124,4 +125,3 @@ class Display: star_len = 3 stars = "*" * star_len self.display("\n%s %s" % (msg, stars), color=color) - diff --git a/v2/bin/ansible b/v2/bin/ansible index 415a12af2c2..7d2f01bc5c5 100755 --- a/v2/bin/ansible +++ b/v2/bin/ansible @@ -72,6 +72,7 @@ class Cli(object): parser.print_help() sys.exit(1) + display.verbosity = options.verbosity validate_conflicts(parser,options) return (options, args) @@ -109,7 +110,7 @@ class Cli(object): if options.listhosts: for host in hosts: - self.display(' %s' % host.name) + self.display.display(' %s' % host.name) sys.exit(0) if ((options.module_name == 'command' or options.module_name == 'shell') and not options.module_args): @@ -163,7 +164,7 @@ class Cli(object): if __name__ == '__main__': display = Display() - #display.display(" ".join(sys.argv), log_only=True) + #display.display(" ".join(sys.argv)) try: cli = Cli(display=display) diff --git a/v2/bin/ansible-playbook b/v2/bin/ansible-playbook index 49748129e12..79c2eed785d 100755 --- a/v2/bin/ansible-playbook +++ b/v2/bin/ansible-playbook @@ -53,6 +53,7 @@ def main(display, args): parser.print_help(file=sys.stderr) return 1 + display.verbosity = options.verbosity validate_conflicts(parser,options) # Note: slightly wrong, this is written so that implicit localhost @@ -154,7 +155,7 @@ def main(display, args): if __name__ == "__main__": display = Display() - display.display(" ".join(sys.argv), log_only=True) + #display.display(" ".join(sys.argv), log_only=True) try: sys.exit(main(display, sys.argv[1:]))