From d3ed603012371268de933affcb48d29901fffd8f Mon Sep 17 00:00:00 2001 From: Sergio Semedi Barranco Date: Thu, 5 Apr 2018 13:40:40 +0200 Subject: [PATCH] F #1918: OCA client, timeout config (#1919) (cherry picked from commit 98d5d3051c8830b44eaaa7eae74a81d6cbdc6e7f) --- src/oca/ruby/opennebula/client.rb | 6 +++++- src/sunstone/etc/sunstone-server.conf | 1 + src/sunstone/sunstone-server.rb | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/oca/ruby/opennebula/client.rb b/src/oca/ruby/opennebula/client.rb index 47df9cb9a5..68c05b8fd1 100644 --- a/src/oca/ruby/opennebula/client.rb +++ b/src/oca/ruby/opennebula/client.rb @@ -153,7 +153,11 @@ module OpenNebula @async = !options[:sync] timeout=nil - timeout=options[:timeout] if options[:timeout] + if options[:timeout] + timeout = options[:timeout] + elsif ENV['ONE_XMLRPC_TIMEOUT'] + timeout = ENV['ONE_XMLRPC_TIMEOUT'].to_i + end http_proxy=nil http_proxy=options[:http_proxy] if options[:http_proxy] diff --git a/src/sunstone/etc/sunstone-server.conf b/src/sunstone/etc/sunstone-server.conf index 2a72e6978f..25668a7ec5 100644 --- a/src/sunstone/etc/sunstone-server.conf +++ b/src/sunstone/etc/sunstone-server.conf @@ -25,6 +25,7 @@ # OpenNebula sever contact information # :one_xmlrpc: http://localhost:2633/RPC2 +:one_xmlrpc_timeout: 60 # Server Configuration # diff --git a/src/sunstone/sunstone-server.rb b/src/sunstone/sunstone-server.rb index 949f1efe79..7558a9691c 100755 --- a/src/sunstone/sunstone-server.rb +++ b/src/sunstone/sunstone-server.rb @@ -109,6 +109,8 @@ rescue Exception => e exit 1 end +ENV['ONE_XMLRPC_TIMEOUT'] = $conf[:one_xmlrpc_timeout].to_s unless ENV['ONE_XMLRPC_TIMEOUT'] + $conf[:debug_level] ||= 3 # Set Sunstone Session Timeout