fix doc to be valid python

This commit is contained in:
Thomas S Hatch 2011-11-26 23:08:44 -07:00
parent d20aaf768d
commit a1d404c1ff

View File

@ -60,16 +60,16 @@ built in ``__opts__`` data can be passed:
import salt.minion
def get_file(path, dest, env='base'):
'''
Used to get a single file from the salt master
'''
Used to get a single file from the salt master
CLI Example:
salt '*' cp.get_file salt://vimrc /etc/vimrc
'''
# Create the FileClient object
client = salt.minion.FileClient(__opts__)
# Call get_file
return client.get_file(path, dest, False, env)
CLI Example:
salt '*' cp.get_file salt://vimrc /etc/vimrc
'''
# Create the FileClient object
client = salt.minion.FileClient(__opts__)
# Call get_file
return client.get_file(path, dest, False, env)
Using the FileClient class outside of a minion module where the ``__opts__``
data is not available, it needs to be generated:
@ -80,13 +80,13 @@ data is not available, it needs to be generated:
import salt.config
def get_file(path, dest, env='base'):
'''
Used to get a single file from the salt master
'''
# Get the configuration data
opts = salt.config.minion_config('/etc/salt/minion')
# Create the FileClient object
client = salt.minion.FileClient(opts)
# Call get_file
return client.get_file(path, dest, False, env)
'''
Used to get a single file from the salt master
'''
# Get the configuration data
opts = salt.config.minion_config('/etc/salt/minion')
# Create the FileClient object
client = salt.minion.FileClient(opts)
# Call get_file
return client.get_file(path, dest, False, env)