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

M #-: Minor adjustements in ruby library load

This commit is contained in:
Tino Vazquez 2020-04-30 17:06:20 +02:00
parent 95ab571b95
commit cccfec2b21
No known key found for this signature in database
GPG Key ID: 2FE9C32E94AEABBE
5 changed files with 9 additions and 11 deletions

View File

@ -16,14 +16,14 @@
# limitations under the License. #
#--------------------------------------------------------------------------- #
ONE_LOCATION = ENV['ONE_LOCATION'] if !defined?(ONE_LOCATION)
ONE_LOCATION ||= ENV['ONE_LOCATION']
if !ONE_LOCATION
RUBY_LIB_LOCATION = '/usr/lib/one/ruby' if !defined?(RUBY_LIB_LOCATION)
GEMS_LOCATION = '/usr/share/one/gems' if !defined?(GEMS_LOCATION)
RUBY_LIB_LOCATION ||= '/usr/lib/one/ruby'
GEMS_LOCATION ||= '/usr/share/one/gems'
else
RUBY_LIB_LOCATION = ONE_LOCATION + '/lib/ruby' if !defined?(RUBY_LIB_LOCATION)
GEMS_LOCATION = ONE_LOCATION + '/share/gems' if !defined?(GEMS_LOCATION)
RUBY_LIB_LOCATION ||= ONE_LOCATION + '/lib/ruby'
GEMS_LOCATION ||= ONE_LOCATION + '/share/gems'
end
if File.directory?(GEMS_LOCATION)
@ -51,5 +51,3 @@ rescue StandardError => e
STDERR.puts "IM poll for NSX cluster #{host_id} failed due to "\
"\"#{e.message}\"\n#{e.backtrace}"
end

View File

@ -16,7 +16,7 @@
# limitations under the License. #
#--------------------------------------------------------------------------- #
ONE_LOCATION = ENV['ONE_LOCATION'] unless defined? ONE_LOCATION
ONE_LOCATION ||= ENV['ONE_LOCATION']
if !ONE_LOCATION
RUBY_LIB_LOCATION ||= '/usr/lib/one/ruby'

View File

@ -16,7 +16,7 @@
# limitations under the License. #
# -------------------------------------------------------------------------- #
ONE_LOCATION ||= ENV['ONE_LOCATION'] unless defined? ONE_LOCATION
ONE_LOCATION ||= ENV['ONE_LOCATION']
if !ONE_LOCATION
RUBY_LIB_LOCATION ||= '/usr/lib/one/ruby'

View File

@ -16,7 +16,7 @@
# limitations under the License. #
# -------------------------------------------------------------------------- #
ONE_LOCATION = ENV['ONE_LOCATION'] unless defined? ONE_LOCATION
ONE_LOCATION ||= ENV['ONE_LOCATION']
if !ONE_LOCATION
RUBY_LIB_LOCATION ||= '/usr/lib/one/ruby'

View File

@ -370,7 +370,7 @@ helpers do
if !two_factor_auth_token || two_factor_auth_token == ""
return [202, { code: "two_factor_auth", uid: user.id }.to_json]
end
serverResponse =
serverResponse =
isTwoFactorAuthSuccessful = false
if isHOTPConfigured && Sunstone2FAuth.authenticate(user[TWO_FACTOR_AUTH_SECRET_XPATH], two_factor_auth_token)
isTwoFactorAuthSuccessful = true