Skip to content

Commit 6b2c63a

Browse files
committed
Update for new provider_worker output
1 parent ce28b2c commit 6b2c63a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

workers/event_catcher/event_catcher.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ def initialize(ems_id, default_endpoint, default_authentication, messaging_opts,
99
@username = default_authentication["userid"]
1010
@password = default_authentication["password"]
1111
@port = default_endpoint["port"]
12-
@messaging_host = messaging_opts["host"]
13-
@messaging_port = messaging_opts["port"]
12+
@messaging_host = messaging_opts["host"] || "localhost"
13+
@messaging_port = messaging_opts["port"] || 9092
1414
@page_size = page_size
1515
end
1616

@@ -246,9 +246,12 @@ def setproctitle
246246
def main(args)
247247
setproctitle
248248

249-
connection_config = args["connection_config"]
249+
ems = args["ems"].detect { |e| e["type"] == "ManageIQ::Providers::Vmware::InfraManager" }
250250

251-
event_catcher = EventCatcher.new(args["ems_id"], connection_config["default"]["endpoint"], connection_config["default"]["authentication"], args["messaging_opts"])
251+
default_endpoint = ems["endpoints"].detect { |ep| ep["role"] == "default" }
252+
default_authentication = ems["authentications"].detect { |auth| auth["authtype"] == "default" }
253+
254+
event_catcher = EventCatcher.new(ems["id"], default_endpoint, default_authentication, {}) # TODO: args["messaging_opts"])
252255

253256
event_catcher.run!
254257
end

0 commit comments

Comments
 (0)