mirror of
https://github.com/OpenNebula/one.git
synced 2025-02-01 05:47:01 +03:00
Show auth token if it cannot be written to ONE_AUTH
This commit is contained in:
parent
2a896ace1a
commit
de66bded58
@ -158,13 +158,6 @@ class OneUserHelper < OpenNebulaHelper::OneHelper
|
||||
auth = TokenAuth.new() #oned generated token
|
||||
end
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Check that ONE_AUTH target can be written
|
||||
#-----------------------------------------------------------------------
|
||||
if File.file?(ONE_AUTH) && !options[:force]
|
||||
return -1, "File #{ONE_AUTH} exists, use --force to overwrite"
|
||||
end
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Authenticate with oned using the token/passwd and set/generate the
|
||||
# authentication token for the user
|
||||
@ -178,6 +171,14 @@ class OneUserHelper < OpenNebulaHelper::OneHelper
|
||||
|
||||
return -1, token_oned.message if OpenNebula.is_error?(token_oned)
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Check that ONE_AUTH target can be written
|
||||
#-----------------------------------------------------------------------
|
||||
if File.file?(ONE_AUTH) && !options[:force]
|
||||
return 0, "File #{ONE_AUTH} exists, use --force to overwrite."\
|
||||
"\nAuthentication Token is:\n#{username}:#{token_oned}"
|
||||
end
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Store the token in ONE_AUTH.
|
||||
#-----------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user