Skip to content

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

Merged
terminalmage merged 2 commits into
saltstack:developfrom
MTecknology:fix-49748
Oct 2, 2018
Merged

terminalmage merged 2 commits into
saltstack:developfrom
MTecknology:fix-49748

Conversation

@MTecknology

@MTecknology MTecknology commented Sep 30, 2018 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

@terminalmage terminalmage left a comment

Copy link
Copy Markdown
Contributor

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

damon-atkins commented Oct 2, 2018 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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

@terminalmage

terminalmage commented Oct 2, 2018 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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