Skip to content
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

Fix usb qube #153

Merged
merged 1 commit into from
Jun 1, 2023
Merged

Fix usb qube #153

merged 1 commit into from
Jun 1, 2023

Conversation

marmarta
Copy link
Member

Fix usb qube handling in Global Config. Based on #150 to avoid hell of merging glade files.

@marmarek
Copy link
Member

This got conflicts

@codecov
Copy link

codecov bot commented May 23, 2023

Codecov Report

Merging #153 (70a1986) into main (7150ab0) will decrease coverage by 0.12%.
The diff coverage is 96.56%.

@@            Coverage Diff             @@
##             main     #153      +/-   ##
==========================================
- Coverage   96.02%   95.91%   -0.12%     
==========================================
  Files          43       43              
  Lines        8177     8266      +89     
==========================================
+ Hits         7852     7928      +76     
- Misses        325      338      +13     
Impacted Files Coverage Δ
qubes_config/global_config/usb_devices.py 93.22% <92.30%> (-1.97%) ⬇️
qubes_config/tests/test_usb_devices.py 99.55% <99.04%> (-0.45%) ⬇️
qubes_config/global_config/global_config.py 84.68% <100.00%> (-2.28%) ⬇️
qubes_config/tests/conftest.py 92.64% <100.00%> (+0.88%) ⬆️
qubes_config/tests/test_global_config.py 99.05% <100.00%> (-0.27%) ⬇️

... and 2 files with indirect coverage changes

while sys_usb not in usb_qube_candidates and policy_candidates:
try:
sys_usb = policy_candidates.pop()
except KeyError:
Copy link
Member

Choose a reason for hiding this comment

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

The loop condition guarantee it won't fail this way here, no? Was it meant to handle different case, like running out of policy_candidates before finding any match?

Treat USB qubes as separate things relevant to each policy part.
Allow user to have multiple or no usb qubes.
Related tests also improved and added.
@marmarek marmarek merged commit a66817b into QubesOS:main Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants