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
Update NetworkEquipment.php - Stacked switch Name with ID #17091
Update NetworkEquipment.php - Stacked switch Name with ID #17091
Conversation
Stacked switches got a name with the "description" (model) field, all switches the same, which gives several issues in managing them. It seems that this was just a wrong copy-paste from the previous code line. Corrected with _$SwitchID as a common naming scheme.
Please provide inventory files examples. |
networkequipment_0_797.zip |
Co-authored-by: Stanislas <skita@teclib.com>
I made another change. In our existing tests, name already contains the stack number, so the new name was something like "xyz - 1 - 1". I changed a bit the code to keep "xyz - 1" on that cases. I also added a unit test based on provided file. |
@Mirkk are our changes OK for you? |
Hi, thanks. As far as I understood from the linked ticket, It could be that "($switch->name ?? $switch->description)" is the stack number on some stacks. However if "$stack_number" is set (and is a number and not "") IMHO it should simply have the precedence, avoiding to add the model name. And you avoid also the check for not adding the number twice. best |
The Existing ones in tests are not affected with latests changes; they were with your initial proposal. |
Hi, |
Since the name/description is present in existing inventories, we have to keep it (and in place) in minor upgrades. Also, it may be something completely different than model or stack number as far as I know. |
Ok, thanks for your work! |
Stacked switches got a name with the "description" (model) field added, all switches the same(!), which gives several issues in managing them, and has apparently no logic.
It seems that this was just a wrong copy-paste from the previous code line. Corrected with _$stack_number as a commonly used naming scheme.