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

Fix Btrfs subvolume snapshot #63025

Merged
merged 2 commits into from
Nov 18, 2022
Merged

Fix Btrfs subvolume snapshot #63025

merged 2 commits into from
Nov 18, 2022

Conversation

a1ro
Copy link
Contributor

@a1ro a1ro commented Nov 6, 2022

What does this PR do?

Hi,

I tried to snapshot a Btrfs subvolume with Salt, but the btrfs.subvolume_snapshot module didn't work on my machine.
I ran this module from both a salt state on master and a salt-call on minion. Either way, I got an error message.

Looking at the code for this module, I believe the source argument was missing while building the cmd list.
By appending source to the cmd list, a snapshot is now created and the command returns successfully.

Previous Behavior

Error message on the minion:

[ERROR   ] Command 'btrfs' failed with return code: 1
[ERROR   ] stderr: btrfs subvolume snapshot: exactly 2 arguments expected, 1 given
[ERROR   ] retcode: 1

Seems like the final command was: btrfs subvolume snapshot [-r] <dest>.

New Behavior

Minion output:

local:
    True

The correct command should be: btrfs subvolume snapshot [-r] <source> <dest>.
This PR adds the missing <source> argument.

Merge requirements satisfied?

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

Commits signed with GPG?

No

@a1ro a1ro requested a review from a team as a code owner November 6, 2022 19:53
@a1ro a1ro requested review from cmcmarrow and removed request for a team November 6, 2022 19:53
@welcome
Copy link

welcome bot commented Nov 6, 2022

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at [email protected]. We’re glad you’ve joined our community and look forward to doing awesome things with you!

Copy link
Contributor

@Ch3LL Ch3LL left a comment

Choose a reason for hiding this comment

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

This will require a changelog and test coverage.

A good place to start is here: tests/pytests/unit/states/test_btrfs.py

@cmcmarrow cmcmarrow added the Needs-Testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases label Nov 17, 2022
@Ch3LL Ch3LL added Sulfur v3006.0 release code name and version and removed Needs-Testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases labels Nov 17, 2022
@MKLeb MKLeb merged commit 021c44f into saltstack:master Nov 18, 2022
@welcome
Copy link

welcome bot commented Nov 18, 2022

Congratulations on your first PR being merged! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sulfur v3006.0 release code name and version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants