Skip to content

Conversation

@berendt
Copy link
Member

@berendt berendt commented Nov 21, 2025

  • Create osism/utils/netbox.py with find_device_by_identifier()
  • Refactor 9 files to use centralized function:
    • osism/api.py
    • osism/commands/baremetal.py (5 locations)
    • osism/commands/sonic.py
    • osism/commands/console.py
    • osism/commands/netbox.py
    • osism/tasks/conductor/utils.py
    • osism/tasks/conductor/sonic/sync.py
    • osism/utils/ssh.py
  • Add comprehensive logging and error handling
  • Maintain backward compatibility

This reduces code duplication by ~40 lines and improves maintainability by providing a single source of truth for device lookup operations.

AI-assisted: Claude Code

- Create osism/utils/netbox.py with find_device_by_identifier()
- Refactor 9 files to use centralized function:
  - osism/api.py
  - osism/commands/baremetal.py (5 locations)
  - osism/commands/sonic.py
  - osism/commands/console.py
  - osism/commands/netbox.py
  - osism/tasks/conductor/utils.py
  - osism/tasks/conductor/sonic/sync.py
  - osism/utils/ssh.py
- Add comprehensive logging and error handling
- Maintain backward compatibility

This reduces code duplication by ~40 lines and improves
maintainability by providing a single source of truth for
device lookup operations.

AI-assisted: Claude Code

Signed-off-by: Christian Berendt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants