fix: hide DB-only regiond commands on rack-only snap - #636
alexsander-souza wants to merge 1 commit into
Conversation
apikey, configauth, config-tls, config-vault, msm, createadmin and changepassword all require the region database. On a rack-only snap there is no local database, so these commands were listed but would fail at runtime. Hide them from the CLI in that mode instead. (cherry picked from commit b7d3441)
c21877f to
f8af2ba
Compare
There was a problem hiding this comment.
[maas-code-reviewer review]
LLM-generated review from https://github.com/canonical/maas-code-reviewer.
Intended to assist a human reviewer, not replace one — suggestions may be
incorrect, please verify before acting.
The implementation correctly hides DB-only commands from the MAAS CLI when running in a rack-only snap environment. The fallback logic and safeguards (such as checking for SNAP_COMMON before calling snap.get_current_mode()) are well thought out. I also appreciate the module-level assertion to ensure that DB_ONLY_REGIOND_COMMANDS stays in sync with REGIOND_COMMANDS. The unit tests adequately cover both the hidden and visible cases.
The code looks solid and I have no additional changes to suggest.
|
this was superseded by the code in the FIPS branch |
apikey, configauth, config-tls, config-vault, msm, createadmin and changepassword all require the region database. On a rack-only snap there is no local database, so these commands were listed but would fail at runtime. Hide them from the CLI in that mode instead.
(cherry picked from commit b7d3441)