currently the messages output by condormatic in the context of condor_refreshd
goto the rails log.
---
src/app/util/condormatic.rb | 16 ++++++++--------
src/condor_refreshd/condor_refreshd | 2 +-
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/app/util/condormatic.rb b/src/app/util/condormatic.rb
index 37040cd..263bb2c 100644
--- a/src/app/util/condormatic.rb
+++ b/src/app/util/condormatic.rb
@@ -157,8 +157,8 @@ def condormatic_instance_destroy(task)
end
-def condormatic_classads_sync
- Rails.logger.info "Starting condormatic_classads_sync..."
+def condormatic_classads_sync(logger=Rails.logger)
+ logger.info "Starting condormatic_classads_sync..."
index = 0
providers = Provider.find(:all)
@@ -182,7 +182,7 @@ def condormatic_classads_sync
# through the provider_combination_* ones. This is a bit
# racy, though, so I'm more inclined to just invalidate
# everything at present.
- Rails.logger.info "Starting classad invalidate..."
+ logger.info "Starting classad invalidate..."
begin
pipe = IO.popen("condor_advertise INVALIDATE_STARTD_ADS 2>&1",
"w+")
pipe.puts 'MyType="Query"'
@@ -191,10 +191,10 @@ def condormatic_classads_sync
out = pipe.read
pipe.close
- Rails.logger.info "Did invalidate, output is #{out}"
+ logger.info "Did invalidate, output is #{out}"
if $? != 0
- Rails.logger.error "Unable to invalidate classads: #{out}"
+ logger.error "Unable to invalidate classads: #{out}"
raise "Unable to invalidate classads, classad sync failed"
end
rescue Errno::EPIPE
@@ -203,7 +203,7 @@ def condormatic_classads_sync
# classads, so we just go on
end
- Rails.logger.info "Syncing classads.."
+ logger.info "Syncing classads.."
ads = []
providers.each { |provider|
# The replicated image entry gets put in the database as soon as we ask
@@ -248,11 +248,11 @@ def condormatic_classads_sync
out = pipe.read
pipe.close
- Rails.logger.error "Unable to submit condor classad: #{out}" if $? != 0
+ logger.error "Unable to submit condor classad: #{out}" if $? != 0
index += 1
}
- Rails.logger.info "done"
+ logger.info "done"
end
def kick_condor
diff --git a/src/condor_refreshd/condor_refreshd b/src/condor_refreshd/condor_refreshd
index 4f1b93c..7b44fff 100755
--- a/src/condor_refreshd/condor_refreshd
+++ b/src/condor_refreshd/condor_refreshd
@@ -98,7 +98,7 @@ begin
while true
begin
- condormatic_classads_sync
+ condormatic_classads_sync(logger)
results = select([socket], nil, nil, timeout * 60)
# if results was nil, we timed out waiting, and we need to do a sync
--
1.7.2.3
Show replies by date
Should've sent this in the same thread as the one I just sent before
this as you need to apply that first.
-Mo