You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While using the script lxca_rest.py, I encountered an issue in the input validation for the parameter "Rack-Tower Server". The script raises an exception even though there is handling for this type. It appears the validation logic does not account for the correct naming.
Additionally, the value "Rack-Tower Server" is returned by Lenovo XClarity Administrator (LXCA) in the REST API call /nodes.
Issue
The condition if type not in type_list: does not account for "Rack-Tower Server", which should be mapped to "Rack-Tower". As a result, passing "Rack-Tower Server" as the input parameter causes an exception.
Impact
The script fails to execute correctly for Rack-Tower servers, and the exception prevents completion of related operations.
Details
The problematic lines are located in the file lxca_rest.py, around lines 439-440:
# Fetch type value from inputtype_list= ["Chassis","Rackswitch","ThinkServer","Storage","Rack-Tower","Edge"]
iftypenotintype_list:
raiseException("Invalid Type Specified")
iftype=="ThinkServer": type="Lenovo ThinkServer"eliftype=="Storage": type="Lenovo Storage"eliftype=="Rack-Tower": type="Rack-Tower Server"eliftype=="Edge": type="Edge Server"
Expected Behavior
The script should correctly validate "Rack-Tower Server" as a valid type and execute without raising an exception.
Actual Behavior
The script raises an exception due to the input validation mismatch.
Proposed Fix
Update the type_list to include "Rack-Tower Server", or adjust the conditional logic to handle the conversion properly.
The value "Rack-Tower Server" is retrieved from LXCA when making the REST API call to /nodes, and this value should be properly handled by the script to ensure compatibility with LXCA's responses.
The text was updated successfully, but these errors were encountered:
Description
While using the script
lxca_rest.py
, I encountered an issue in the input validation for the parameter"Rack-Tower Server"
. The script raises an exception even though there is handling for this type. It appears the validation logic does not account for the correct naming.Additionally, the value
"Rack-Tower Server"
is returned by Lenovo XClarity Administrator (LXCA) in the REST API call/nodes
.Issue
The condition
if type not in type_list:
does not account for"Rack-Tower Server"
, which should be mapped to"Rack-Tower"
. As a result, passing"Rack-Tower Server"
as the input parameter causes an exception.Impact
The script fails to execute correctly for Rack-Tower servers, and the exception prevents completion of related operations.
Details
The problematic lines are located in the file
lxca_rest.py
, around lines 439-440:Expected Behavior
The script should correctly validate "Rack-Tower Server" as a valid type and execute without raising an exception.
Actual Behavior
The script raises an exception due to the input validation mismatch.
Proposed Fix
Update the type_list to include "Rack-Tower Server", or adjust the conditional logic to handle the conversion properly.
Add a conversion step
Additional Context
The value "Rack-Tower Server" is retrieved from LXCA when making the REST API call to /nodes, and this value should be properly handled by the script to ensure compatibility with LXCA's responses.
The text was updated successfully, but these errors were encountered: