YADRO-KNS / sebastes

Pydantic code generator for Redfish targets
MIT License
1 stars 0 forks source link

Some resources are not created as models #6

Open Denis-Alexeev opened 2 years ago

Denis-Alexeev commented 2 years ago

Describe the bug Some of models are not created because of similar child and and parrent names of different resources.

2022-05-25 15:11:03 - RMG - [14] Scanning: /redfish/v1/Chassis/Baseboard/Sensors parent is Element - ChassisCollectionChassis
2022-05-25 15:11:04 - RMG - [15] Scanning: /redfish/v1/Chassis/Baseboard/Thermal parent is Element - ChassisCollectionChassis
2022-05-25 15:11:06 - RMG - [16] Scanning: /redfish/v1/Chassis/VEGMAN_N110_Server parent is Collection - ChassisCollection
2022-05-25 15:11:08 - RMG - [16] Scanning: /redfish/v1/Chassis/VEGMAN_N110_Server/Power parent is Element - ChassisCollectionChassis
2022-05-25 15:11:11 - RMG - [16] Scanning: /redfish/v1/Chassis/VEGMAN_N110_Server/Sensors parent is Element - ChassisCollectionChassis
2022-05-25 15:11:12 - RMG - [16] Scanning: /redfish/v1/Chassis/VEGMAN_N110_Server/Sensors/PSU1_Input_Current parent is Collection - ChassisSensorCollection

Resource /redfish/v1/Chassis/Baseboard/Sensors was created with parent Element - ChassisCollectionChassis But /redfish/v1/Chassis/VEGMAN_N110_Server/Sensors with parentElement - ChassisCollectionChassis was not created. Neither did all its children.

Expected behavior redfish/v1/Chassis/VEGMAN_N110_Server/Sensors and its children are created.

Environment (please complete the following information):

Shooshp commented 2 years ago

Basic investigation - some parent resources have children with the same names but different models. I am not sure that it is ok according to Redfish or OpenAPI standards. Simplest solution in my opinion is to introduce one more criteria for model equality (hash or frozen set of model field names for example). Also we need to update model names to prevent conflicts during scripts \ imports creation.