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

F #1871: Asked to the user if he want to overwrite one_auth (#1878)

This commit is contained in:
juanmont 2018-03-20 18:55:08 +01:00 committed by Tino Vázquez
parent 0c2dcba089
commit 038d7289a9

View File

@ -215,8 +215,20 @@ class OneUserHelper < OpenNebulaHelper::OneHelper
# Check that ONE_AUTH target can be written
#-----------------------------------------------------------------------
if File.file?(ONE_AUTH) && !options[:force]
puts " * Do you want to overwrite the file #{ONE_AUTH}? (Y|N): "
answer = STDIN.readline.chop
case answer
when 'Y', 'y', 'yes', 'YES', 'Yes'
puts "overwriting #{ONE_AUTH} ..."
when 'N', 'n', 'no', 'NO', 'No'
return 0, "File #{ONE_AUTH} exists, use --force to overwrite."\
"\n#{token_info}"
else
puts "Not valid option."
return -1
end
end
#-----------------------------------------------------------------------