mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix traceback when virtualenv.managed is invoked with nonexistant user
This commit is contained in:
parent
b042484455
commit
e3cfd29d6b
1 changed files with 7 additions and 2 deletions
|
@ -14,7 +14,7 @@ import os
|
|||
import salt.version
|
||||
import salt.utils
|
||||
|
||||
from salt.exceptions import CommandNotFoundError
|
||||
from salt.exceptions import CommandExecutionError, CommandNotFoundError
|
||||
|
||||
from salt.ext import six
|
||||
log = logging.getLogger(__name__)
|
||||
|
@ -237,7 +237,12 @@ def managed(name,
|
|||
|
||||
# Populate the venv via a requirements file
|
||||
if requirements or pip_pkgs:
|
||||
before = set(__salt__['pip.freeze'](bin_env=name, user=user, use_vt=use_vt))
|
||||
try:
|
||||
before = set(__salt__['pip.freeze'](bin_env=name, user=user, use_vt=use_vt))
|
||||
except CommandExecutionError as exc:
|
||||
ret['result'] = False
|
||||
ret['comment'] = exc.strerror
|
||||
return ret
|
||||
|
||||
if requirements:
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue