Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit ControllerAddress changed signal in SwitchController method #968

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/agent/agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -1939,12 +1939,16 @@ static int agent_method_switch_controller(sd_bus_message *m, void *userdata, UNU
"Failed to switch controller because already connected to the controller");
}

if (!agent_set_controller_address(agent, dbus_address)) {
if (!agent_set_controller_address(agent, dbus_address) ||
engelmi marked this conversation as resolved.
Show resolved Hide resolved
!agent_set_orch_address(agent, dbus_address)) {
bc_log_error("Failed to set CONTROLLER ADDRESS");
return sd_bus_reply_method_errorf(m, SD_BUS_ERROR_FAILED, "Failed to set CONTROLLER ADDRESS");
}

bc_log_infof("CONTROLLER ADDRESS changed to %s", dbus_address);
r = sd_bus_emit_properties_changed(
agent->api_bus, BC_AGENT_OBJECT_PATH, AGENT_INTERFACE, "ControllerAddress", NULL);
if (r < 0) {
bc_log_errorf("Failed to emit controller address property changed: %s", strerror(-r));
}

agent_disconnected(NULL, userdata, NULL);

Expand Down