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

This commit is contained in:
Jaime Melis committed 2014-11-18 18:01:04 +01:00
1 parent 8294534a57
commit f40d69d0bd
2 files changed
+21 -2

No files matched your search

+10 -1
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
+11 -1
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)