Skip to content

Commit

Permalink
Handle None/empty and numeric SLS modules listed in include declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
leeclemens committed Dec 31, 2023
1 parent 1d0dfde commit 0121e4e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog/56253.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Handle None/empty and numeric SLS modules listed in include declarations
12 changes: 12 additions & 0 deletions salt/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -4422,6 +4422,18 @@ def render_state(self, sls, saltenv, mods, matches, local=False, context=None):
errors.append(msg)
continue

if not hasattr(inc_sls, "startswith"):
if inc_sls is None:
msg = (
"Empty include found in include "
"in SLS '{}:{}'".format(saltenv, sls)
)
log.error(msg)
errors.append(msg)
continue
else:
inc_sls = str(inc_sls)

if inc_sls.startswith("."):
match = re.match(r"^(\.+)(.*)$", inc_sls)
if match:
Expand Down

0 comments on commit 0121e4e

Please sign in to comment.