Skip to content

Conversation

@twangboy
Copy link
Contributor

@twangboy twangboy commented Nov 3, 2025

What does this PR do?

Reverts part of #68156 that changed the default behavior for python_shell and shell. Also fixes a bug in the PR mentioned above, where you couldn't pass non-list parameters to a script.

What issues does this PR fix or reference?

Fixes #68156

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

@jonaschl
Copy link

jonaschl commented Nov 4, 2025

Is this a fix to #68298 ? If yes, thanks, as this regression has broken some code of mine.

if (
python_shell is not True
and shell is not None
and not salt.utils.platform.is_windows()
Copy link
Contributor

@bdrx312 bdrx312 Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You updated utils.shlex_split to work with windows, so I think this and not salt.utils.platform.is_windows() should be removed.

Comment on lines +1620 to +1623
if "python_shell" in kwargs:
python_shell = kwargs.pop("python_shell")
else:
python_shell = False
python_shell = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just python_shell = kwargs.pop("python_shell", True)

"""
if isinstance(s, str):
return shlex.split(s, **kwargs)
if sys.platform == "win32":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this use salt.utils.platform.is_windows() instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants