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 return False when target exists (file.rename) #49843

Merged
merged 2 commits into from
Oct 2, 2018
Merged

Don't return False when target exists (file.rename) #49843

merged 2 commits into from
Oct 2, 2018

Conversation

MTecknology
Copy link
Contributor

@MTecknology MTecknology commented Sep 30, 2018

What does this PR do?

This PR applies the change recommended by @DickerDackel in #49748.

Previous Behavior

When using file.rename and then creating a new file in it's place, subsequent executions will fail due to a file existing in it's place.

New Behavior

This patch removes the False return when a destination file exists if -force:False.

Tests written?

Yes

Commits signed with GPG?

Yes

@rallytime
Copy link
Contributor

@MTecknology Thanks for submitting this! There's a test failing here: https://jenkinsci.saltstack.com/job/pr-kitchen-ubuntu1604-py2/job/PR-49843/1/

Can you take a look?

Copy link
Contributor

@terminalmage terminalmage left a comment

Choose a reason for hiding this comment

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

This looks good and the failing test just needs to be updated to reflect the new return value.

@damon-atkins
Copy link
Contributor

damon-atkins commented Oct 2, 2018

Please doco the change in behavior in doc/topics/releases/neon.rst

On a side note, not an issue with this PR. However file.copy() has been change to file.copy_() in develop branch? Update found

__func_alias__ = {
    'copy_': 'copy',
}

No Problem.

@terminalmage
Copy link
Contributor

You can ignore that, @MTecknology, there is no need to document a bugfix in the release notes.

@terminalmage
Copy link
Contributor

terminalmage commented Oct 2, 2018

We run a changelog script that adds this sort of stuff for us.

@terminalmage terminalmage merged commit e828e2f into saltstack:develop Oct 2, 2018
@terminalmage
Copy link
Contributor

Ahh, after reading the original issue it's clear that this was not 100% bugfix, so I'll get the change documented.

@MTecknology
Copy link
Contributor Author

@terminalmage Thanks!

@MTecknology MTecknology deleted the fix-49748 branch October 5, 2018 16:37
garethgreenaway added a commit to garethgreenaway/salt that referenced this pull request Sep 18, 2019
@dwoz dwoz added the has master-port port to master has been created label Oct 17, 2019
dwoz added a commit that referenced this pull request Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has master-port port to master has been created
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants