mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Catch the 404 error from fileclient
This commit is contained in:
parent
a563af29d3
commit
0110786fa9
1 changed files with 5 additions and 1 deletions
|
@ -28,6 +28,7 @@ from distutils.version import LooseVersion # pylint: disable=E0611
|
|||
|
||||
# Import salt libs
|
||||
import salt.utils
|
||||
from salt.exceptions import MinionError
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
@ -465,7 +466,10 @@ def install(name=None, refresh=False, pkgs=None, saltenv='base', **kwargs):
|
|||
cached_pkg = __salt__['cp.is_cached'](installer, saltenv)
|
||||
if not cached_pkg:
|
||||
# It's not cached. Cache it, mate.
|
||||
cached_pkg = __salt__['cp.cache_file'](installer, saltenv)
|
||||
try:
|
||||
cached_pkg = __salt__['cp.cache_file'](installer, saltenv)
|
||||
except MinionError as exc:
|
||||
return '{0}: {1}'.format(exc, installer)
|
||||
if not cached_pkg:
|
||||
return 'Unable to cache file {0} from saltenv: {1}'\
|
||||
.format(installer, saltenv)
|
||||
|
|
Loading…
Add table
Reference in a new issue