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

LVM many small fixes #58133

Merged
merged 8 commits into from Aug 24, 2020
Merged

LVM many small fixes #58133

merged 8 commits into from Aug 24, 2020

Conversation

piterpunk
Copy link
Collaborator

What does this PR do?

This PR does a few visible changes:

This PR does also an invisible change to the user, default answers.

Some LVM commands asks questions to the user, but the user isn't there to answer any of them. To avoid this situation, we used the "force" paramenter to set the default answers. It's invisible because the current behaviour is preserved. The functions that already had the "yes" or "force" hardcoded are now with the "force" defaulted to True. The functions that didn't have it, now have the "force" defaulted to False.

What issues does this PR fix or reference?

Fixes: #52363 #56089

Merge requirements satisfied?

Commits signed with GPG?

No

piterpunk added 6 commits August 5, 2020 03:41
- The LVM commands does a lot of tests before any destructive operation.
  Usually these tests prompts questions and waits for the user answers.
  But the user is not there to answer any of them.
- Some functions in the module have a "force" parameter which defaults
  the answers to "yes". Others have the "yes" hardcoded. And others yet
  have the "force" parameter in examples e documentation but no code to
  handle it.
- Added the "force" parameter on all destructive operations.
- Those functions which previously have the "yes" hardcoded, had the
  "force" parameter defaulted to "True"
- Functions which didn't have the "force" parameter have it defaulted to
  "False" and now the "False" forces all answers to be "no".
- Also, added the parameter "resizefs" to lvm.lvresize
- pvcreate and pvremove from linux_lvm execution module raises a
  trackback when they should fail graciously.
- Initial work to remove the trackbacks and substitute then with
  clean failures.
    - Fixed the tests for pvcreate and pvremove from linux_lvm so
      they didn't expect a trackback as return anymore.
    - The exception trackback cleaning is done.
  - Added new functions to linux_lvm.py module
  - lvextend to increase the size of a logical volume and
  - pvresize to resize a physical volume to the current physical
    device size.
- Added tests for pvresize and lvextend
- Added support to shrink a LVM logical volume in state lvm.lv_present
- Added support to resize filesystem in state lvm.lv_present
- Fixed linux_lvm.py modules to have some output even with '-qq'
- Adjusted tests in test_linux_lvm and test_lvm to complies with the
  modifications in linux_lvm module and lvm state. Most of them to
  handle the change from cmd.run to cmd.run_all
@piterpunk piterpunk requested a review from a team as a code owner August 5, 2020 07:10
@ghost ghost requested review from cmcmarrow and removed request for a team August 5, 2020 07:10
@cmcmarrow
Copy link
Contributor

@piterpunk thanks for the PR. Its good to be merged.

dwoz
dwoz approved these changes Aug 24, 2020
@dwoz dwoz merged commit af9b0a6 into saltstack:master Aug 24, 2020
27 checks passed
@sagetherage sagetherage added the Magnesium Mg release after Na prior to Al label Sep 14, 2020
@piterpunk piterpunk deleted the lvm_many_small_fixes branch September 29, 2020 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has-failing-test Magnesium Mg release after Na prior to Al
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lvm.lv_present state allow resize trackback instead of clean fail in lvm.pv_present when disk doesn't exist
4 participants