Skip to content

Commit ec251e1

Browse files
committed
keylimectl: Fix agent retrieval from registrar
Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
1 parent 735fe40 commit ec251e1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

keylimectl/src/client/registrar.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -539,12 +539,9 @@ impl RegistrarClient {
539539
.map_err(KeylimectlError::from)?;
540540

541541
// Extract agent data from registrar response format
542+
// The registrar API returns agent data directly in "results", not nested under agent UUID
542543
if let Some(results) = json_response.get("results") {
543-
if let Some(agent_data) = results.get(agent_uuid) {
544-
Ok(Some(agent_data.clone()))
545-
} else {
546-
Ok(None)
547-
}
544+
Ok(Some(results.clone()))
548545
} else {
549546
Ok(Some(json_response))
550547
}

keylimectl/src/commands/agent.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1969,7 +1969,10 @@ mod tests {
19691969
push_model: false,
19701970
};
19711971

1972-
assert_eq!(params.agent_id, "550e8400-e29b-41d4-a716-446655440000");
1972+
assert_eq!(
1973+
params.agent_id,
1974+
"550e8400-e29b-41d4-a716-446655440000"
1975+
);
19731976
assert!(params.ip.is_none());
19741977
assert!(params.port.is_none());
19751978
assert!(!params.verify);

0 commit comments

Comments
 (0)