Skip to content

Commit edd2fb5

Browse files
Victor ZhestkovVictor Zhestkov
authored andcommitted
Make config compatible with salt 3004
1 parent cd0f596 commit edd2fb5

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

saline/config/__init__.py

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,24 @@
77
import salt.utils.user
88

99
from salt.config import _validate_opts
10-
from salt._logging import (
11-
DFLT_LOG_DATEFMT,
12-
DFLT_LOG_DATEFMT_LOGFILE,
13-
DFLT_LOG_FMT_CONSOLE,
14-
DFLT_LOG_FMT_JID,
15-
DFLT_LOG_FMT_LOGFILE,
16-
)
10+
try:
11+
from salt._logging import (
12+
DFLT_LOG_DATEFMT,
13+
DFLT_LOG_DATEFMT_LOGFILE,
14+
DFLT_LOG_FMT_CONSOLE,
15+
DFLT_LOG_FMT_JID,
16+
DFLT_LOG_FMT_LOGFILE,
17+
)
18+
except ImportError:
19+
# Reuired to be compatible with Salt 3004
20+
DFLT_LOG_DATEFMT = "%H:%M:%S"
21+
DFLT_LOG_DATEFMT_LOGFILE = "%Y-%m-%d %H:%M:%S"
22+
DFLT_LOG_FMT_CONSOLE = "[%(levelname)-8s] %(message)s"
23+
DFLT_LOG_FMT_JID = "[JID: %(jid)s]"
24+
DFLT_LOG_FMT_LOGFILE = (
25+
"%(asctime)s,%(msecs)03d [%(name)-17s:%(lineno)-4d][%(levelname)-8s][%(process)d]"
26+
" %(message)s"
27+
)
1728

1829

1930
log = logging.getLogger(__name__)

0 commit comments

Comments
 (0)