Skip to content

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

Open
nickanderson wants to merge 1 commit into
cfengine:masterfrom
nickanderson:CFE-942/master
Open

CFE-942: Fixed usemodule() reporting success when the module exited non-zero#6273
nickanderson wants to merge 1 commit into
cfengine:masterfrom
nickanderson:CFE-942/master

Conversation

@nickanderson

Copy link
Copy Markdown
Member

ExecModule() hands the exit status back to the caller now, so a module which ran and failed makes usemodule() false while one which could not be run at all is still a function failure.

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>
@nickanderson
nickanderson requested a review from larsewi August 5, 2026 21:04
@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