From 7be8d134c9f91d71c08270786a0ca18a2e49b1e9 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Thu, 23 Feb 2012 22:47:03 -0500 Subject: [PATCH] Rename 'successful' to 'contacted' ... --- README.md | 10 +++++++--- lib/ansible/__init__.py | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e58f194651..b88d6e88e5 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,10 @@ Run a module by name with arguments API Example =========== -The API is simple and returns basic datastructures. +The API is simple and returns basic datastructures. Ansible will keep +track of which hosts were successfully contacted seperately from hosts +that had communication problems. The format of the return, if successful, +is entirely up to the module. import ansible runner = ansible.Runner( @@ -86,17 +89,18 @@ The API is simple and returns basic datastructures. data = runner.run() { - 'successful' : { + 'contacted' : { 'xyz.example.com' : [ 'any kind of datastructure is returnable' ], 'foo.example.com' : [ '...' ] }, - 'failed' : { + 'dark' : { 'bar.example.com' : [ 'failure message' ] } } Additional options to Runner include the number of forks, hostname exclusion pattern, library path, arguments, and so on. + Read the source, it's not complicated. Patterns diff --git a/lib/ansible/__init__.py b/lib/ansible/__init__.py index 420b3fe039..39375e4d55 100755 --- a/lib/ansible/__init__.py +++ b/lib/ansible/__init__.py @@ -155,8 +155,8 @@ class Runner(object): hosts = [ (self,x) for x in hosts ] results = pool.map(_executor_hook, hosts) results2 = { - "successful" : {}, - "failed" : {} + "contacted" : {}, + "dark" : {} } for x in results: (host, is_ok, result) = x