diff --git a/src/cli/one_helper.rb b/src/cli/one_helper.rb index 5935c3f1e7..e0d884f76e 100644 --- a/src/cli/one_helper.rb +++ b/src/cli/one_helper.rb @@ -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 diff --git a/src/cli/one_helper/oneuser_helper.rb b/src/cli/one_helper/oneuser_helper.rb index d53e190c10..4d567c6d8c 100644 --- a/src/cli/one_helper/oneuser_helper.rb +++ b/src/cli/one_helper/oneuser_helper.rb @@ -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)