mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Merge pull request #8187 from terminalmage/issue8156
Make newly-added repo available to pkg states
This commit is contained in:
commit
245ebd120f
@ -418,6 +418,11 @@ def installed(
|
|||||||
if not isinstance(version, basestring) and version is not None:
|
if not isinstance(version, basestring) and version is not None:
|
||||||
version = str(version)
|
version = str(version)
|
||||||
|
|
||||||
|
if salt.utils.is_true(refresh) or os.path.isfile(rtag):
|
||||||
|
__salt__['pkg.refresh_db']()
|
||||||
|
if os.path.isfile(rtag):
|
||||||
|
os.remove(rtag)
|
||||||
|
|
||||||
result = _find_install_targets(name, version, pkgs, sources,
|
result = _find_install_targets(name, version, pkgs, sources,
|
||||||
fromrepo=fromrepo, **kwargs)
|
fromrepo=fromrepo, **kwargs)
|
||||||
try:
|
try:
|
||||||
@ -449,26 +454,14 @@ def installed(
|
|||||||
'comment': comment}
|
'comment': comment}
|
||||||
|
|
||||||
comment = []
|
comment = []
|
||||||
if salt.utils.is_true(refresh) or os.path.isfile(rtag):
|
pkg_ret = __salt__['pkg.install'](name,
|
||||||
pkg_ret = __salt__['pkg.install'](name,
|
refresh=False,
|
||||||
refresh=True,
|
version=version,
|
||||||
version=version,
|
fromrepo=fromrepo,
|
||||||
fromrepo=fromrepo,
|
skip_verify=skip_verify,
|
||||||
skip_verify=skip_verify,
|
pkgs=pkgs,
|
||||||
pkgs=pkgs,
|
sources=sources,
|
||||||
sources=sources,
|
**kwargs)
|
||||||
**kwargs)
|
|
||||||
if os.path.isfile(rtag):
|
|
||||||
os.remove(rtag)
|
|
||||||
else:
|
|
||||||
pkg_ret = __salt__['pkg.install'](name,
|
|
||||||
refresh=False,
|
|
||||||
version=version,
|
|
||||||
fromrepo=fromrepo,
|
|
||||||
skip_verify=skip_verify,
|
|
||||||
pkgs=pkgs,
|
|
||||||
sources=sources,
|
|
||||||
**kwargs)
|
|
||||||
if isinstance(pkg_ret, dict):
|
if isinstance(pkg_ret, dict):
|
||||||
changes = pkg_ret
|
changes = pkg_ret
|
||||||
elif isinstance(pkg_ret, basestring):
|
elif isinstance(pkg_ret, basestring):
|
||||||
|
Loading…
Reference in New Issue
Block a user