1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-23 22:50:09 +03:00

M #-: Remove validate inputs, it breaks fireedge (#2012)

This commit is contained in:
Jan Orel 2022-05-05 17:12:31 +02:00 committed by GitHub
parent 6251f0acac
commit 8b9f6f7c98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 41 deletions

View File

@ -151,7 +151,6 @@ module OneProvision
eval_user_inputs
validate_user_inputs
rescue StandardError => e
Utils.fail("Failed to read configuration: #{e}")
end
@ -833,27 +832,6 @@ module OneProvision
answer
end
# Validate user inputs
def validate_user_inputs
return unless @config['ceph_vars']
osd_full_hosts_count = 0
@config['hosts'].each do |h|
if h['provision'] && h['provision']['ceph_group'] == 'osd,mon'
osd_full_hosts_count += h['provision']['hostname'].length
elsif h['provision'] && h['provision']['ceph_full_count']
osd_full_hosts_count += \
h['provision']['ceph_full_count'].to_i
end
end
return if [3, 5].include? osd_full_hosts_count
Utils.warn('Recomended number of Mon+OSD Ceph hosts ' \
"is 3 or 5, given #{osd_full_hosts_count}")
end
end
end

View File

@ -85,25 +85,6 @@ module OneProvision
exit(code)
end
# Shows warning and ask to continue
#
# @param text [String] Error message
# @param code [Integer] Error code
def warn(text, code = -1)
STDOUT.puts "WARN: #{text}"
STDOUT.puts 'Continue? yes/no'
answer = STDIN.readline.chop
until %w[YES NO].include?(answer.upcase)
STDOUT.puts "Invalid #{answer}, put yes/no"
STDOUT.puts 'Continue?'
answer = STDIN.readline.chop
end
exit(code) if answer.upcase == 'NO'
end
# Checks if the return_code is error
def exception(return_code)
error = OpenNebula.is_error?(return_code)