From: Martyn Taylor <mtaylor(a)redhat.com>
---
src/app/util/condormatic.rb | 6 ++++++
src/config/condor.yml | 12 ++++++++++++
2 files changed, 18 insertions(+), 0 deletions(-)
create mode 100644 src/config/condor.yml
diff --git a/src/app/util/condormatic.rb b/src/app/util/condormatic.rb
index b52ff46..82815b4 100644
--- a/src/app/util/condormatic.rb
+++ b/src/app/util/condormatic.rb
@@ -29,6 +29,7 @@ class Possible
@hwp = hwp
@provider_image = provider_image
@realm = realm
+ @condor_config = YAML.load_file("#{RAILS_ROOT}/config/condor.yml")
end
end
@@ -82,6 +83,10 @@ def condormatic_instance_create(task)
instance.provider_account = found.account
+ # Determine request timeout from /config/condor.yml
+ provider_type_codename = @account.provider.provider_type.codename
+ request_timeout = @condor_config[:request_timeout].key?(provider_type_codename) ?
@condor_config[:request_timeout][provider_type_codename] :
@condor_config[:request_timeout]["default"]
+
# I use the 2>&1 to get stderr and stdout together because popen3 does not
# support the ability to get the exit value of the command in ruby 1.8.
pipe = IO.popen("condor_submit 2>&1", "w+")
@@ -93,6 +98,7 @@ def condormatic_instance_create(task)
pipe_and_log(pipe, "DeltacloudUsername =
#{found.account.credentials_hash['username']}\n")
pipe_and_log(pipe, "DeltacloudPasswordFile = #{pwfilename}")
pipe_and_log(pipe, "DeltacloudImageId =
#{found.provider_image.target_identifier}\n")
+ pipe_and_log(pipe, "DeltacloudRetryTimeout = #{request_timeout}\n")
pipe_and_log(pipe,
"DeltacloudHardwareProfile = #{found.hwp.external_key}\n")
pipe_and_log(pipe,
diff --git a/src/config/condor.yml b/src/config/condor.yml
new file mode 100644
index 0000000..52e15d6
--- /dev/null
+++ b/src/config/condor.yml
@@ -0,0 +1,12 @@
+# Condor Request Timeout (in seconds)
+:request_timeout:
+ default: 180
+ # Uncomment to override default request timeout for paritular provider type
+ # mock 180
+ # gogrid: 180
+ # rackspace: 180
+ # opennebula: 180
+ # ec2: 180
+ # condorcloud: 180
+ # rhevm: 180
+ # vsphere: 180
--
1.7.4
Show replies by thread