-
Notifications
You must be signed in to change notification settings - Fork 21
Add SizeTriple class; remove size_triple function #1229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SizeTriple class; remove size_triple function #1229
Conversation
Fix a bug where printing out a filesystem detail view would result in a stack trace if the used D-Bus value was not valid. Signed-off-by: mulhern <amulhern@redhat.com>
WalkthroughIntroduces a new SizeTriple class for handling total/used/free size calculations, removes the old size_triple formatter, and refactors filesystem and pool listing actions to use SizeTriple with TABLE_FAILURE_STRING fallbacks for None values. Imports are updated accordingly; no public interfaces changed except the new class. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant UI as CLI Action (List Filesystem/Pool)
participant S as SizeTriple
participant D as Data Source (fs/pool props)
participant F as Formatter (TABLE_FAILURE_STRING)
UI->>D: Read total size, used size (may be None)
UI->>S: Construct SizeTriple(total, used)
UI->>S: total()
S-->>UI: Range
UI->>S: used()
S-->>UI: Optional[Range]
UI->>S: free()
S-->>UI: Optional[Range] (total - used or None)
UI->>F: Format trio, substituting TABLE_FAILURE_STRING for None
F-->>UI: Display strings (Total / Used / Free [...limit])
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
🧰 Additional context used🧬 Code graph analysis (2)src/stratis_cli/_actions/_list_pool.py (2)
src/stratis_cli/_actions/_list_filesystem.py (2)
🔇 Additional comments (10)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Related #1225