Skip to content

Commit

Permalink
util: update init flags to include --quiet on >= 5.x
Browse files Browse the repository at this point in the history
Related to voxpupuli#867
  • Loading branch information
tylerjl committed Aug 21, 2017
1 parent 73124ce commit 897addf
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions lib/puppet_x/elastic/es_versioning.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,23 @@ class EsVersioning

# Create an array of command-line flags to append to an `elasticsearch`
# startup command.
def self.opt_flags(package_name, catalog, opts=DEFAULT_OPTS)
def self.opt_flags(package_name, catalog, opts = DEFAULT_OPTS)
opt_flag = opt_flag(min_version('5.0.0', package_name, catalog))

opts.delete 'work' if min_version '5.0.0', package_name, catalog
opts.delete 'home' if min_version '5.4.0', package_name, catalog

if min_version '6.0.0', package_name, catalog
[opt_flag, []]
else
[opt_flag, opts.map { |k, v| "-#{opt_flag}default.path.#{k}=${#{v}}" }.sort]
end
opt_args = if min_version '6.0.0', package_name, catalog
[]
else
opts.map do |k, v|
"-#{opt_flag}default.path.#{k}=${#{v}}"
end.sort
end

opt_args << '--quiet' if min_version '5.0.0', package_name, catalog

[opt_flag, opt_args]
end

# Get the correct option flag depending on whether Elasticsearch is post
Expand Down

0 comments on commit 897addf

Please sign in to comment.