State mount.fstab_present respects mount parameter - #57669
Merged
dwoz merged 10 commits intoOct 5, 2020
Merged
Conversation
added 8 commits
June 13, 2020 16:46
- mount.fstab_present have a parameter called "mount" which should mount an fstab entry after created. - But this is passed to set_filesystems, which uses it as a property of /etc/filesystems in AIX and indicates that a entry will be mounted by "mount all" or "mount -a" commands. - Added the parameter fs_mount which will be used as input to the mount paremeter in mount.set_filesystems module.
- Previously the mount.mount needs at least the device and the mount point. Using this approach it doesn't use the /etc/fstab entries. - Change to needs only the mount point. - You still can use the device, but now is an optional parameter.
- Added the documented but missing feature to mount a filesystem after added it to /etc/fstab or /etc/filesystems when parameter "mount" is set to "true".
- When using salt-call to apply the state, when mount.fstab_present calls disk.blkid the state execution never ends. Works fine when called from salt master. - Workarounded by calling blkid directly in mount.py state.
This reverts commit 09b6840. Find a better way to fix the problem with salt-call and the neverending execution
Still don't know what happens here. But this:
HAS_HDPARM = salt.utils.path.which("hdparm") is not None
HAS_IOSTAT = salt.utils.path.which("iostat") is not None
@salt.utils.decorators.depends(HAS_HDPARM)
...
@salt.utils.decorators.depends(HAS_IOSTAT)
...
Wasn't working fine with salt-call. Removed the two HAS_SOMETHING
lines and changed the others that were referencing this variables to:
@salt.utils.path.which("hdparm")
@salt.utils.path.which("iostat")
And now the state is working fine called from salt-call and from
salt master.
- Now when you run mount.fstab_present state in "test" mode it will check for "mount" parameter and emmit a message if it will or not try to mount the filesystem
- Includes the check for parameter mount=true or mount=false in fstab_present tests.
krionbsd
previously approved these changes
Jun 15, 2020
…arameter_Fix-Issue-57560
krionbsd
approved these changes
Oct 3, 2020
piterpunk
deleted the
state-mount.fstab_present-respects-mount-parameter_Fix-Issue-57560
branch
October 8, 2020 22:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
The mount=true parameter to mount a fstab entry after created by mount.fstab_present was in documentation but there isn't code to handle it.
Also, the actual mount=true parameter was being passed to mount.set_filesystems to totally different finality, "mount" is used in AIX /etc/filesystems to mark a filesystem to be mounted by command "mount all"
What issues does this PR fix or reference?
Fixes: #57560
Previous Behavior
The "mount" parameter was passed to mount.set_filesystems on AIX machines marking filesystems to being mounted by "mount all" command and ignored by the others OSs.
New Behavior
The "mount" parameter is used to mount /etc/fstab entries after created by mount.fstab_present status, as indicated in documentation.
Added the "fs_mount" to be used as input to mount.set_filesystems to AIX machines. Both "mount" and "fs_mount" defaults to "True"
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
salt-runtests-20200614142849.log
Commits signed with GPG?
No