Skip to content

Bug: node_id generation uses display hostname instead of system hostname #1936

@mrveiss

Description

@mrveiss

Problem

_generate_node_id() in api/nodes.py:268-271 generates a deterministic node_id by hashing node_data.hostname. Since hostname stores user-provided display names (e.g., 00-SLM-Manager) rather than actual system hostnames (Issue #1814), the same physical machine could get different node_ids if enrolled with different display names.

Impact

Severity: low — most enrollments provide explicit node_id. But when fallback is used, the generated ID is non-deterministic relative to the actual machine.

Suggested Fix

Use ansible_name (added in PR #1932) or ip_address for the hash when node_id is not provided.

Discovered During

Working on #1814 (nodes.hostname data quality)

Location

autobot-slm-backend/api/nodes.py:262-271

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions