Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the logging for sync_config out of the sync_config method
This was a problem for the EventCatcher when sync_config was called as a part of worker initialization. The EventCatcher uses its ems hostname as a part of its log prefix, but the ems isn't set up until after the first call to sync_config. This was leading to errors when the worker was starting: [----] I, [2019-12-19T17:51:48.407958 ManageIQ#11054:2ab1a6d9a5f8] INFO -- : Starting ManageIQ::Providers::Vmware::InfraManager::EventCatcher with runner options {:ems_id=>"2", :guid=>"43a315ba-39ff-4326-99a6-89b3af48b1ee"} [----] I, [2019-12-19T17:51:48.451836 ManageIQ#11054:2ab1a6d9a5f8] INFO -- : Deleting worker record for ManageIQ::Providers::Vmware::InfraManager::EventCatcher, id 310 /home/ncarboni/Source/manageiq/app/models/manageiq/providers/base_manager/event_catcher/runner.rb:63:in `log_prefix': undefined method `hostname' for nil:NilClass (NoMethodError) from /home/ncarboni/Source/manageiq/app/models/miq_worker/runner.rb:242:in `sync_config' from /home/ncarboni/Source/manageiq/app/models/miq_worker/runner.rb:52:in `worker_initialization' from /home/ncarboni/Source/manageiq/app/models/miq_worker/runner.rb:42:in `initialize' from /home/ncarboni/Source/manageiq/lib/workers/bin/run_single_worker.rb:113:in `new' from /home/ncarboni/Source/manageiq/lib/workers/bin/run_single_worker.rb:113:in `<main>'
- Loading branch information