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
Describe the bug
When calling the LinchpinAPI do_validation function, it returns a tuple containing the return code, and the results of the validation. The do_validation always returns 'successful' because the rc is 0 but it's not until you run do_action, where it does another validation and throws a ValidationException error on the layout fields.
Looks like do_validation calls validator function validate_pretty, where as do_action is calling validate. In validate_pretty the only time the return code is changed to non-zero is if topology validation fails but not if layout or cfgs validation fails. validate_pretty should be returning non-zero for all schema key failures.
To Reproduce
Unfortunately this won't be reproduceable through the CLI because the shell __ini__.py doesn't even use the return code to detect failure, it uses the actual results data, and does a string check for certain key indicators.
Steps to reproduce the behavior:
Create a pinfile with improper layout schema
Open python console
Import json, LinchpinAPI, LinchpinContext modules
Use json module to load the pinfile data
Intialize a LinchpinAPI with a LinchpinContext
Provide the pinfile dict to the LinchpinAPI.do_validation()
Inspect that rc is 0 but results shows error in layout
Expected behavior
If layout is specified in the pinfile and do_validation fails due to improper layout schema it should return a non-zero rc code.
The text was updated successfully, but these errors were encountered:
Describe the bug
When calling the LinchpinAPI
do_validation
function, it returns a tuple containing the return code, and the results of the validation. Thedo_validation
always returns 'successful' because the rc is 0 but it's not until you rundo_action
, where it does another validation and throws a ValidationException error on the layout fields.Looks like
do_validation
calls validator functionvalidate_pretty
, where asdo_action
is callingvalidate
. Invalidate_pretty
the only time the return code is changed to non-zero is if topology validation fails but not iflayout
orcfgs
validation fails.validate_pretty
should be returning non-zero for all schema key failures.To Reproduce
Unfortunately this won't be reproduceable through the CLI because the shell
__ini__.py
doesn't even use the return code to detect failure, it uses the actual results data, and does a string check for certain key indicators.Steps to reproduce the behavior:
json
,LinchpinAPI
,LinchpinContext
modulesLinchpinAPI
with aLinchpinContext
LinchpinAPI.do_validation()
Expected behavior
If layout is specified in the pinfile and
do_validation
fails due to improper layout schema it should return a non-zero rc code.The text was updated successfully, but these errors were encountered: