mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge branch '2015.8' into '2016.3'
No conflicts.
This commit is contained in:
commit
a7c9a72104
2 changed files with 9 additions and 5 deletions
|
@ -341,6 +341,8 @@ def get_file_str(path, saltenv='base', env=None):
|
|||
'''
|
||||
Return the contents of a file from a URL
|
||||
|
||||
Returns ``False`` if Salt was unable to cache a file from a URL.
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
@ -357,9 +359,11 @@ def get_file_str(path, saltenv='base', env=None):
|
|||
saltenv = env
|
||||
|
||||
fn_ = cache_file(path, saltenv)
|
||||
with salt.utils.fopen(fn_, 'r') as fp_:
|
||||
data = fp_.read()
|
||||
return data
|
||||
if isinstance(fn_, six.string_types):
|
||||
with salt.utils.fopen(fn_, 'r') as fp_:
|
||||
data = fp_.read()
|
||||
return data
|
||||
return fn_
|
||||
|
||||
|
||||
def cache_file(path, saltenv='base', env=None):
|
||||
|
|
|
@ -800,8 +800,8 @@ class Pillar(object):
|
|||
self.rend = salt.loader.render(self.opts, self.functions)
|
||||
matches = self.top_matches(top)
|
||||
pillar, errors = self.render_pillar(matches, errors=errors)
|
||||
pillar = merge(pillar,
|
||||
self.opts['pillar'],
|
||||
pillar = merge(self.opts['pillar'],
|
||||
pillar,
|
||||
self.merge_strategy,
|
||||
self.opts.get('renderer', 'yaml'),
|
||||
self.opts.get('pillar_merge_lists', False))
|
||||
|
|
Loading…
Add table
Reference in a new issue