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

Backport #23171 to 2014.7 #23228

Merged
merged 1 commit into from
Apr 30, 2015
Merged

Backport #23171 to 2014.7 #23228

merged 1 commit into from
Apr 30, 2015

Conversation

rallytime
Copy link
Contributor

Backport #23171 to 2014.7

Upon testing (in my Windows environment), I noticed that in
clean_proc_dir():
    job = salt.payload.Serial(opts).load(fp_)

The result would always be that 'job' is None. Upon further
investigation, this seems to be the case because of this line above:
    job_data = fp_.read()

If I remove that line, things work as expected. So it seems like the
'fp_.read()' will move the current file position of 'fp_' to the end,
and so 'salt.payload.Serial(opts).load(fp_)' would end up reading what
it thinks is an empty file.

Looking at the logic, it seems like 'job_data = fp_.read()' is an
unnecessary step in any case, so it has been removed.

I have noticed that this same incorrect logic also exists in the 2015.2
and 2014.7 branches.

Also, added a fix for deleting files on Windows which was already in
another part of the same function.

Signed-off-by: Sergey Kizunov <sergey.kizunov@ni.com>
jfindlay added a commit that referenced this pull request Apr 30, 2015
@jfindlay jfindlay merged commit f20210e into saltstack:2014.7 Apr 30, 2015
@rallytime rallytime deleted the bp-23171 branch May 3, 2015 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants