Skip to content

CFE-942: Fixed usemodule() reporting success when the module exited non-zero (3.24) - #6286

Open
nickanderson wants to merge 1 commit into
cfengine:3.24.xfrom
nickanderson:CFE-942/3.24.x
Open

CFE-942: Fixed usemodule() reporting success when the module exited non-zero (3.24)#6286
nickanderson wants to merge 1 commit into
cfengine:3.24.xfrom
nickanderson:CFE-942/3.24.x

Conversation

@nickanderson

Copy link
Copy Markdown
Member

Backport of #6273. usemodule() now returns false when the module ran and exited
non-zero, and only fails as a function when the module could not be run at all.

Ticket: CFE-942

usemodule() ignored the module's exit status and defined its class either way.
It returns false now when the module ran and failed, and only fails as a
function when the module could not be run or read at all. The distinction
matters: a failed function call leaves the class undefined rather than false,
so "not => usemodule(...)" would not have become true either.

The test could not pass or fail whatever the code did. It looked for the modules
one directory too high, its Pass guard asked for a class and its own negation,
and the module it runs exits 1 on purpose which failed the whole test bundle.
With those corrected it fails on the old code and passes on the new.

Ticket: CFE-942
Changelog: Title
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit a5b28ff)
@nickanderson

Copy link
Copy Markdown
Member Author

@cf-bottom jenkins please

@cf-bottom

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants