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

Support for pure yaml in is_master.rb #741

Merged

Conversation

h-haaks
Copy link
Contributor

@h-haaks h-haaks commented Apr 9, 2024

Pull Request (PR) description

To be able to use pure yaml in mongod.conf the mongodb_is_master fact has to support both dot format and pure yaml formats.

Comment on lines 13 to 18
port = config['net.port']
port = config.fetch('net', {}).fetch('port', nil) if port.nil?
ipv6 = config['net.ipv6']
ipv6 = config.fetch('net', {}).fetch('ipv6', nil) if ipv6.nil?
tls_mode = config['net.tls.mode']
tls_mode = config.fetch('net', {}).fetch('tls', {}).fetch('mode', nil) if tls_mode.nil?
Copy link
Contributor

Choose a reason for hiding this comment

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

Have a look at

'bindip' => config['net.bindIp'] || config.fetch('net', {}).fetch('bindIp', nil),

I think that is the better way to support both formats, same effect, more compact code.

@h-haaks h-haaks force-pushed the real-yaml-in-is_master-fact branch from 433300e to f315040 Compare April 10, 2024 08:14
@h-haaks h-haaks force-pushed the real-yaml-in-is_master-fact branch from f315040 to a521a9b Compare April 10, 2024 08:17
@h-haaks h-haaks merged commit 5de468c into voxpupuli:master Apr 10, 2024
68 checks passed
@h-haaks h-haaks deleted the real-yaml-in-is_master-fact branch April 10, 2024 09:14
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.

2 participants