Only print exception if effective loglevel is DEBUG

This commit is contained in:
Erik Johnson 2014-03-04 12:55:22 -06:00
parent 803d197f34
commit 9ade2a9337

View File

@ -38,7 +38,6 @@ 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
@ -155,10 +154,10 @@ def fileserver_update(fileserver):
'able to serve files to minions')
raise SaltMasterError('No fileserver backends available')
fileserver.update()
except Exception:
except Exception as exc:
log.error(
'Exception occurred in file server update:\n{0}'
.format(traceback.format_exc())
'Exception {0} occurred in file server update'.format(exc),
exc_info=log.isEnabledFor(logging.DEBUG)
)