Make meta/results output more consistent.
@@ -83,20 +83,19 @@ def print_meta(state, inventory):
for host in hosts:
meta = state.meta[host.name]
- if host.name in state.active_hosts:
+ # Didn't connect to this host?
+ if host.name not in state.connected_hosts:
+ logger.info('[{0}]\tNo connection'.format(
+ colored(host.name, 'red', attrs=['bold']),
+ ))
+ continue
+
logger.info(
'[{0}]\tOperations: {1}\t Commands: {2}'.format(
colored(host.name, attrs=['bold']),
meta['ops'], meta['commands']
)
)
- else:
- logger.info(
- '[{0}]\t{1}'.format(
- colored(host.name, attrs=['bold']),
- colored('No connection', 'red'),
- )
- )
if i != len(group_combinations):
print()
@@ -111,11 +110,13 @@ def print_results(state, inventory):
))
for host in hosts:
+ # Didn't conenct to this host?
if host.name not in state.connected_hosts:
logger.info('[{0}]\tNo connection'.format(
colored(host.name, 'red', attrs=['bold'])
))
- else:
+ continue
+
results = state.results[host.name]
meta = state.meta[host.name]
