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

Bug #3341: Temporary fix that fixes de broken pipe use but breaks the CLI SSL support for Ruby 1.8.7

(cherry picked from commit f40d69d0bdb22712b2b8b2f68fde235f68c2e725)
This commit is contained in:
Jaime Melis 2014-11-18 18:01:04 +01:00
parent 464ec1b4b1
commit 1363fdacdd
2 changed files with 21 additions and 2 deletions

View File

@ -370,7 +370,16 @@ EOT
endpoint=options[:endpoint]
end
@@client=OpenNebula::Client.new(secret, endpoint, :sync => true)
# This breaks the CLI SSL support for Ruby 1.8.7, but is necessary
# in order to do template updates, otherwise you get the broken pipe
# error (bug #3341)
if RUBY_VERSION < '1.9'
sync = false
else
sync = true
end
@@client=OpenNebula::Client.new(secret, endpoint, :sync => sync)
end
end

View File

@ -162,10 +162,20 @@ class OneUserHelper < OpenNebulaHelper::OneHelper
# Authenticate with oned using the token/passwd and set/generate the
# authentication token for the user
#-----------------------------------------------------------------------
# This breaks the CLI SSL support for Ruby 1.8.7, but is necessary
# in order to do template updates, otherwise you get the broken pipe
# error (bug #3341)
if RUBY_VERSION < '1.9'
sync = false
else
sync = true
end
token = auth.login_token(username, options[:time])
login_client = OpenNebula::Client.new("#{username}:#{token}",
nil,
:sync => true)
:sync => sync)
user = OpenNebula::User.new(User.build_xml, login_client)