mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Deprecate __env__
in favor of saltenv
This commit is contained in:
parent
9c493ba0e6
commit
fce52f87ee
@ -191,7 +191,11 @@ def _verify_binary_pkg(srcinfo):
|
|||||||
return problems
|
return problems
|
||||||
|
|
||||||
|
|
||||||
def parse_targets(name=None, pkgs=None, sources=None, **kwargs):
|
def parse_targets(name=None,
|
||||||
|
pkgs=None,
|
||||||
|
sources=None,
|
||||||
|
saltenv='base',
|
||||||
|
**kwargs):
|
||||||
'''
|
'''
|
||||||
Parses the input to pkg.install and returns back the package(s) to be
|
Parses the input to pkg.install and returns back the package(s) to be
|
||||||
installed. Returns a list of packages, as well as a string noting whether
|
installed. Returns a list of packages, as well as a string noting whether
|
||||||
@ -203,6 +207,16 @@ def parse_targets(name=None, pkgs=None, sources=None, **kwargs):
|
|||||||
|
|
||||||
salt '*' pkg_resource.parse_targets
|
salt '*' pkg_resource.parse_targets
|
||||||
'''
|
'''
|
||||||
|
if '__env__' in kwargs:
|
||||||
|
salt.utils.warn_until(
|
||||||
|
'Helium',
|
||||||
|
'Passing a salt environment should be done using \'saltenv\' '
|
||||||
|
'not \'__env__\'. This functionality will be removed in Salt '
|
||||||
|
'Helium.'
|
||||||
|
)
|
||||||
|
# Backwards compatibility
|
||||||
|
saltenv = kwargs['__env__']
|
||||||
|
|
||||||
if __grains__['os'] == 'MacOS' and sources:
|
if __grains__['os'] == 'MacOS' and sources:
|
||||||
log.warning('Parameter "sources" ignored on MacOS hosts.')
|
log.warning('Parameter "sources" ignored on MacOS hosts.')
|
||||||
|
|
||||||
@ -228,9 +242,7 @@ def parse_targets(name=None, pkgs=None, sources=None, **kwargs):
|
|||||||
# Cache package from remote source (salt master, HTTP, FTP)
|
# Cache package from remote source (salt master, HTTP, FTP)
|
||||||
srcinfo.append((pkg_name,
|
srcinfo.append((pkg_name,
|
||||||
pkg_src,
|
pkg_src,
|
||||||
__salt__['cp.cache_file'](pkg_src,
|
__salt__['cp.cache_file'](pkg_src, saltenv),
|
||||||
kwargs.get('__env__',
|
|
||||||
'base')),
|
|
||||||
'remote'))
|
'remote'))
|
||||||
else:
|
else:
|
||||||
# Package file local to the minion
|
# Package file local to the minion
|
||||||
|
Loading…
Reference in New Issue
Block a user