Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use binary mode for cmdmod.exec_code #34198

Merged
merged 1 commit into from
Jun 22, 2016

Conversation

lukasraska
Copy link
Contributor

What does this PR do?

Fixes cmdmod.exec_code on Windows machines due to invalid file mode.

What issues does this PR fix or reference?

Fixes #34196

Previous Behavior

 The minion function caused an exception: Traceback (most recent call last):
      File "c:\salt\bin\lib\site-packages\salt\minion.py", line 1318, in _thread_return
        return_data = executor.execute()
      File "c:\salt\bin\lib\site-packages\salt\executors\direct_call.py", line 28, in execute
        return self.func(*self.args, **self.kwargs)
      File "c:\salt\bin\lib\site-packages\salt\modules\cmdmod.py", line 2296, in exec_code_all
        with salt.utils.fopen(codefile, 'w+t') as fp_:
      File "c:\salt\bin\lib\site-packages\salt\utils\__init__.py", line 1209, in fopen
        fhandle = open(*args, **kwargs)
    ValueError: Invalid mode ('w+tb')

New Behavior

Successfully executed

Tests written?

Not required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants