Skip to content

Commit abee996

Browse files
committed
Fix review issues
Fixes review issues - Unecessary None default in .get() - Defining new fmt strings as optional
1 parent 89a4292 commit abee996

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

salt/_logging/impl.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,23 +248,21 @@ def _log(
248248
if extra is None:
249249
extra = {}
250250

251-
current_jid = (
252-
salt.utils.ctx.get_request_context().get("data", {}).get("jid", None)
253-
)
251+
current_jid = salt.utils.ctx.get_request_context().get("data", {}).get("jid")
254252
log_fmt_jid = (
255253
salt.utils.ctx.get_request_context()
256254
.get("opts", {})
257255
.get("log_fmt_jid", None)
258256
)
259257

260258
current_minion_id = (
261-
salt.utils.ctx.get_request_context().get("data", {}).get("id", None)
259+
salt.utils.ctx.get_request_context().get("data", {}).get("id")
262260
)
263261

264262
log_fmt_minion_id = (
265263
salt.utils.ctx.get_request_context()
266264
.get("opts", {})
267-
.get("log_fmt_minion_id", None)
265+
.get("log_fmt_minion_id")
268266
)
269267

270268
if current_jid is not None:

salt/config/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,9 @@ def _gather_buffer_space():
352352
# The format for a given log file
353353
"log_fmt_logfile": (tuple, str),
354354
# The format for JIDs prior to formatting into log lines as %(jid)s
355-
"log_fmt_jid": str,
355+
"log_fmt_jid": (type(None), str),
356356
# The format for minion_ids prior to formatting into log lines as %(minion_id)s
357-
"log_fmt_minion_id": str,
357+
"log_fmt_minion_id": (type(None), str),
358358
# A dictionary of logging levels
359359
"log_granular_levels": dict,
360360
# The maximum number of bytes a single log file may contain before

0 commit comments

Comments
 (0)