From: Jan Provaznik <[email protected]>
this patch is not correct, but makes conromatic not to throw exceptions :).
a condor expert should look at condormatic and fix it correctly
---
src/app/util/condormatic.rb | 58 ++++++++++++++++++++-----------------------
1 files changed, 27 insertions(+), 31 deletions(-)
diff --git a/src/app/util/condormatic.rb b/src/app/util/condormatic.rb
index 3491f7f..9564075 100644
--- a/src/app/util/condormatic.rb
+++ b/src/app/util/condormatic.rb
@@ -36,12 +36,12 @@ def condormatic_instance_create(task)
Rails.logger.info "universe = grid\n"
pipe.puts "executable = #{job_name}\n"
Rails.logger.info "executable = #{job_name}\n"
- pipe.puts "grid_resource = dcloud $$(provider_url) $$(username)
$$(password) $$(image_key) #{instance.name} $$(realm_key)
$$(hardwareprofile_key)\n"
- Rails.logger.info "grid_resource = dcloud $$(provider_url) $$(username)
$$(password) $$(image_key) #{instance.name} $$(realm_key)
$$(hardwareprofile_key)\n"
+ pipe.puts "grid_resource = dcloud $$(provider_url) $$(username)
$$(password) $$(template_key) #{instance.name} $$(realm_key)
$$(hardwareprofile_key)\n"
+ Rails.logger.info "grid_resource = dcloud $$(provider_url) $$(username)
$$(password) $$(template_key) #{instance.name} $$(realm_key)
$$(hardwareprofile_key)\n"
pipe.puts "log = #{job_log}\n"
Rails.logger.info "log = #{job_log}\n"
- requirements = "requirements = hardwareprofile ==
\"#{instance.hardware_profile.id}\" && image == \"#{instance.image.id}\""
+ requirements = "requirements = hardwareprofile ==
\"#{instance.hardware_profile.id}\" && template == \"#{instance.template.id}\""
requirements += " && realm == \"#{realm.name}\"" if realm != nil
requirements += "\n"
@@ -174,34 +174,30 @@ def condormatic_classads_sync
providers.each do |provider|
provider.cloud_accounts.each do |account|
- provider.images.each do |image|
- provider.hardware_profiles.each do |hwp|
- provider.realms.each do |realm|
- pipe = IO.popen("condor_advertise UPDATE_STARTD_AD 2>&1", "w+")
-
- pipe.puts "Name=\"provider_combination_#{index}\""
- pipe.puts 'MyType="Machine"'
- pipe.puts 'Requirements=true'
- pipe.puts "\n# Stuff needed to match:"
- pipe.puts
"hardwareprofile=\"#{hwp.aggregator_hardware_profiles[0].id}\""
- pipe.puts "image=\"#{image.aggregator_images[0].id}\""
- pipe.puts "realm=\"#{realm.name}\""
- pipe.puts "\n# Backend info to complete this job:"
- pipe.puts "image_key=\"#{image.external_key}\""
- pipe.puts "hardwareprofile_key=\"#{hwp.external_key}\""
- pipe.puts "realm_key=\"#{realm.external_key}\""
- pipe.puts "provider_url=\"#{account.provider.url}\""
- pipe.puts "username=\"#{account.username}\""
- pipe.puts "password=\"#{account.password}\""
- pipe.close_write
-
- out = pipe.read
- pipe.close
-
- Rails.logger.error "Unable to submit condor classad: #{out}" if $?
!= 0
-
- index += 1
- end
+ provider.hardware_profiles.each do |hwp|
+ provider.realms.each do |realm|
+ pipe = IO.popen("condor_advertise UPDATE_STARTD_AD 2>&1", "w+")
+
+ pipe.puts "Name=\"provider_combination_#{index}\""
+ pipe.puts 'MyType="Machine"'
+ pipe.puts 'Requirements=true'
+ pipe.puts "\n# Stuff needed to match:"
+ pipe.puts
"hardwareprofile=\"#{hwp.aggregator_hardware_profiles[0].id}\""
+ pipe.puts "realm=\"#{realm.name}\""
+ pipe.puts "\n# Backend info to complete this job:"
+ pipe.puts "hardwareprofile_key=\"#{hwp.external_key}\""
+ pipe.puts "realm_key=\"#{realm.external_key}\""
+ pipe.puts "provider_url=\"#{account.provider.url}\""
+ pipe.puts "username=\"#{account.username}\""
+ pipe.puts "password=\"#{account.password}\""
+ pipe.close_write
+
+ out = pipe.read
+ pipe.close
+
+ Rails.logger.error "Unable to submit condor classad: #{out}" if $?
!= 0
+
+ index += 1
end
end
end
--
1.7.2.2
_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel