Unify nextcloud/sqlite/gpg_key/ipa_diff plugins + safe fixes + tests#269
Merged
Conversation
…es + tests Bring the remaining in-house plugins to the standard style: standard file header, single quotes, f-strings (replacing the last .format() calls in sqlite_query and gpg_key), modern ansible.module_utils.common.text.converters instead of the deprecated _text, fixed import ordering, and removal of leftover boilerplate / commented-out debug code. ipa_diff gains the standard header it lacked. Security: - gpg_key no longer passes input_data (which contains the cleartext passphrase) into fail_json on a failed key generation. Safe fixes: - sqlite_query: REGEXP no longer raises on NULL column values (returns no-match); bare 'except:' narrowed to 'except Exception:'; mutable default argument replaced with None. Add unit tests: ipa_diff (pure diff helpers), sqlite_query (connect / select / regexp / close against a real temp DB) and gpg_key (match_key). Deferred (behaviour-changing, separate PRs): sqlite_query reporting a failed query as a successful run, and nextcloud_occ_app_config array idempotency.
ebuerki-lf
pushed a commit
that referenced
this pull request
May 26, 2026
…es + tests (#269) Bring the remaining in-house plugins to the standard style: standard file header, single quotes, f-strings (replacing the last .format() calls in sqlite_query and gpg_key), modern ansible.module_utils.common.text.converters instead of the deprecated _text, fixed import ordering, and removal of leftover boilerplate / commented-out debug code. ipa_diff gains the standard header it lacked. Security: - gpg_key no longer passes input_data (which contains the cleartext passphrase) into fail_json on a failed key generation. Safe fixes: - sqlite_query: REGEXP no longer raises on NULL column values (returns no-match); bare 'except:' narrowed to 'except Exception:'; mutable default argument replaced with None. Add unit tests: ipa_diff (pure diff helpers), sqlite_query (connect / select / regexp / close against a real temp DB) and gpg_key (match_key). Deferred (behaviour-changing, separate PRs): sqlite_query reporting a failed query as a successful run, and nextcloud_occ_app_config array idempotency.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 5 (final family): the
nextcloud_occ_*modules,sqlite_query,gpg_key, and theipa_diffmodule_util. This completes the in-house plugin unification (vendoredipa*/lvm_pv/gnupgstay as-is).Style unification (no behavior change)
ipa_diffhad none)..format()calls insqlite_queryandgpg_key),ansible.module_utils.common.text.convertersinstead of the deprecated_text, fixed import ordering insqlite_query,from __future__without parens.gpg_key), the no-opfprefix on placeholder-less strings, and the(object)base class (ipa_diff).Security
gpg_keyno longer passesinput_data(which contains the cleartext passphrase) intofail_jsonwhen key generation fails.Safe fixes
sqlite_query: aREGEXPquery against a column containing NULL no longer raises (NULL simply does not match); bareexcept:narrowed toexcept Exception:; mutable default argument replaced withNone.Deferred (behavior-changing, separate PRs)
sqlite_queryreports a failed query as a successful run (theselect()success flag is ignored inmain()).nextcloud_occ_app_configarray values are compared asstr(list)vs JSON string and never match (needs verification against realoccoutput per the empirical-facts rule).Tests
test_ipa_diff.py(pure diff helpers),test_sqlite_query.py(connect / select / regexp / close against a real temp DB, incl. the NULL-REGEXP case),test_gpg_key.py(match_key).Validation
ansible-docrenders all five modules; the doc guard passes.