Skip to content

fix: hide DB-only regiond commands on rack-only snap - #636

Closed
alexsander-souza wants to merge 1 commit into
canonical:3.8from
alexsander-souza:bp_b7d344190_to_3_8
Closed

alexsander-souza wants to merge 1 commit into
canonical:3.8from
alexsander-souza:bp_b7d344190_to_3_8

Conversation

@alexsander-souza

Copy link
Copy Markdown
Contributor

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)

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)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

@alexsander-souza alexsander-souza added the blocked do not merge this label Sep 9, 2026
@alexsander-souza

Copy link
Copy Markdown
Contributor Author

this was superseded by the code in the FIPS branch

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

Labels

3.8 blocked do not merge this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant