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

(PUP-7807) Add mount options on AIX remount #6283

Merged

Conversation

MosesMendoza
Copy link
Contributor

Contains the content of PR #6105, but with added test and a bit of refactor/DRYup. See that PR for context.

Jarret Lavallee and others added 3 commits August 7, 2017 07:19
Prior to this commit, the mount resource on AIX would not remount NFS
shares with the mount options specified. Since AIX did not read the NFS
options from the `/etc/filesystems`, the share would be remounted
without options.

This commit adds a simple check to ensure all AIX remounts are done with
the specified options including JFS2.
Building on prior work, this commit DRYs up the code in mount a bit, sharing
behavior between bsd and aix, and breaking out a couple utility methods. A test
is added to assert that on AIX, if remounts is true and options are specified,
we pass the specified options with the appropriate 'remount' command.

Signed-off-by: Moses Mendoza <moses@puppet.com>
@MosesMendoza
Copy link
Contributor Author

@adrienthebo should be good, but can you validate my little refactor/added spec?

@puppetcla
Copy link

CLA signed by all contributors.

else
unmount
mount
end
end

def remount_with_option(option)
Copy link
Contributor

Choose a reason for hiding this comment

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

This method would benefit from documentation indicating that it'll both remount with a specific option, as well as the contents of the options parameter if the field is set.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed. update pushed

end

def using_explicit_options?
!self.options.nil? && !self.options.empty?
Copy link
Contributor

Choose a reason for hiding this comment

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

I'll give you extra points if you use DeMorgan's law to convert this to !(self.options.nil? || self.options.empty?) - that is if you think this is more clear.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

While that would be correct, I was trying to mimic the thought flow - ie, we're really saying "as long as this thing isn't nil, and as long as it's not empty", so this made the most sense to me.

Clarify what's happening in the #remount_with_option command.

Signed-off-by: Moses Mendoza <moses@puppet.com>
@adrienthebo adrienthebo merged commit f74eb05 into puppetlabs:master Oct 16, 2017
@MosesMendoza
Copy link
Contributor Author

thanks again @jarretlavallee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants