Skip to content

Commit

Permalink
Doc: fix library examples
Browse files Browse the repository at this point in the history
* Since ClusterShell 1.8 the output returned is a MsgTreeElem object,
  adapted the examples in the documentation with the proper syntax to
  get the output from it.

Change-Id: If58510061385d26022ec6c7bdbb9806df849619c
  • Loading branch information
volans- committed Aug 8, 2018
1 parent 9dbc1c7 commit 9f91342
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions doc/source/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ Simple example without fine-tuning of optional parameters::
worker.handler = 'sync'
exit_code = worker.execute() # Execute the command on all hosts in parallel
for nodes, output in worker.get_results(): # Cycle over the results
print('{nodes}:\n{output}\n------'.format(nodes=nodes, output=output))
print(nodes)
print(output.message().decode())
print('-----')


More complex example fine-tuning many of the parameters::

Expand All @@ -169,4 +172,6 @@ More complex example fine-tuning many of the parameters::
worker.handler = 'async'
exit_code = worker.execute()
for nodes, output in worker.get_results():
print('{nodes}:\n{output}\n------'.format(nodes=nodes, output=output))
print(nodes)
print(output.message().decode())
print('-----')

0 comments on commit 9f91342

Please sign in to comment.