Skip to content

issue#203: Fix HP Comware username prompt typo (usernmae -> username) - #205

Merged
TheWitness merged 1 commit into
developfrom
issue203-comware-usernmae
Nov 16, 2026
Merged

TheWitness merged 1 commit into
developfrom
issue203-comware-usernmae

Conversation

@TheWitness

Copy link
Copy Markdown
Member

Summary

Fixes #203. The built-in HP Comware device type seeded its Telnet username prompt as the misspelled usernmae:. PHPConnection matches this value as a case-insensitive regex against the Telnet output, so a device that prints Username: never matched and Telnet logins gave up after their retries. SSH logins are unaffected.

Changes

  • setup.php — seed fix (AddDeviceTypes()): corrected the HP Comware username prompt from usernmae: to username:, matching the Cisco types. Fixes fresh installs.
  • setup.php — upgrade migration (new < 2.0 gate in routerconfigs_check_upgrade()): a conditional UPDATE that rewrites the HP Comware promptuser to username: only while it is still exactly usernmae:, so any value an admin changed is left alone. This is needed because AddDeviceType() skips a type whose name already exists, so changing the seed alone would not fix existing installs.
  • CHANGELOG.md: added an issue#203 entry under the existing --- 2.0 --- section.

Notes

  • INFO version left at 2.0 (unreleased; latest tag is v1.7), so the < 2.0 gate covers all affected installs and fresh 2.0 installs get the corrected seed.
  • php -l setup.php passes.
  • Not tested against a physical Comware device (same as the issue report); the change mirrors the existing Cisco seed values and the migration is a guarded, exact-match update.

Copilot AI balanced review requested due to automatic review settings November 16, 2026 14:43
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The migration’s collation-sensitive comparison can overwrite customized prompts, so it needs a binary comparison to replace only the original seeded value.

1 open issue
What changed in this PR

Addresses #203 by correcting the HP Comware Telnet username prompt in the built-in device type and adding an upgrade migration for existing installations. SSH behavior is unchanged.

Changes:

  • Corrects the seeded prompt from usernmae: to username:.
  • Adds a pre-2.0 migration intended to preserve admin-customized prompts.
  • Documents the fix in the 2.0 changelog.
File Description
setup.php Corrects the HP Comware seed and adds the guarded upgrade migration.
CHANGELOG.md Records the Telnet prompt fix and migration under version 2.0.

Review effort: Balanced

Comment thread setup.php Resolved
@TheWitness
TheWitness merged commit 034ab5b into develop Nov 16, 2026
8 checks passed
@TheWitness
TheWitness deleted the issue203-comware-usernmae branch November 16, 2026 15:10
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.

HP Comware built-in device type misspells its username prompt as "usernmae:"

3 participants