Log tracebacks caught in fileserver updates

When a traceback is triggered in a fileserver update, it is caught and
printed. However, all that is printed is the result of exc.__str__(),
which is not helpful when debugging, and makes it harder to track down
fileserver update issues. This commit changes the behavior and writes
the full text of the exception to the master log.
This commit is contained in:
Erik Johnson 2014-03-03 19:43:16 -06:00
parent 8ef2fce934
commit 8fda2fe288

View File

@ -38,6 +38,7 @@ import salt.utils.event
import salt.utils.verify
import salt.utils.minions
import salt.utils.gzip_util
import traceback
from salt.utils.event import tagify
from salt.exceptions import SaltMasterError
@ -154,9 +155,10 @@ def fileserver_update(fileserver):
'able to serve files to minions')
raise SaltMasterError('No fileserver backends available')
fileserver.update()
except Exception as exc:
except Exception:
log.error(
'Exception {0} occurred in file server update'.format(exc)
'Exception occurred in file server update:\n{0}'
.format(traceback.format_exc())
)