mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
fix doc to be valid python
This commit is contained in:
parent
d20aaf768d
commit
a1d404c1ff
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user