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

Drop support for mongodb versions before 2.6 #504

Merged
merged 1 commit into from
Oct 20, 2018

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Oct 14, 2018

No description provided.

@ekohl
Copy link
Member Author

ekohl commented Oct 14, 2018

I considered dropping the old config file format but it may break on upgrades when the file hasn't been rewritten yet:

def get_options_from_keyvalue_config(file)
config = {}
File.readlines(file).map do |line|
k, v = line.split('=')
config[k.rstrip] = v.lstrip.chomp if k && v
end
result = []
result << "--port #{config['port']}" unless config['port'].nil?
result << "--ssl --host #{Facter.value(:fqdn)}" if config['ssl'] == 'requireSSL'
result << "--sslPEMKeyFile #{config['sslcert']}" unless config['sslcert'].nil?
result << "--sslCAFile #{config['sslca']}" unless config['sslca'].nil?
result << '--ipv6' unless config['ipv6'].nil?
result.join(' ')
end

end
cmd_json = <<-EOS.gsub(%r{^\s*}, '').gsub(%r{$\n}, '')
Copy link
Member Author

Choose a reason for hiding this comment

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

I'll rewrite this with a .to_json as well in a separate PR in a separate PR.

@@ -133,7 +92,7 @@ def password_hash=(_value)
end

def password=(value)
if mongo_24? || mongo_26?
if mongo_26?
Copy link
Member Author

Choose a reason for hiding this comment

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

The docs indicate this method should also work on 3.x and 4.x but I'll look into that later when I have acceptance tests

Copy link
Member

@bastelfreak bastelfreak left a comment

Choose a reason for hiding this comment

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

I am not an expert for types and providers, but this looks good to me and also the tests pass.

Copy link
Contributor

@llowder llowder left a comment

Choose a reason for hiding this comment

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

I'm not super familiar with mongo, but I didn't see any obvious red flags or things that made me stop and think "Now why is it done this way...?"

And, the tests and checks pass.

@ekohl ekohl merged commit fa66548 into voxpupuli:master Oct 20, 2018
@ekohl ekohl deleted the drop-mongo24 branch October 20, 2018 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants