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: Do not remove swap at every run #396

Merged
merged 1 commit into from
Oct 17, 2023
Merged

fix: Do not remove swap at every run #396

merged 1 commit into from
Oct 17, 2023

Conversation

scaronni
Copy link
Contributor

@scaronni scaronni commented Oct 9, 2023

Enhancement: The role is not idempotent if the system has swap. At every execution, the swap entries are remove and re-added in the next task.

Reason: There is specific code that deletes swap unconditionally. I could not find any apparent real reason for this piece of code to exist.

Result: Role is idempotent.

@codecov
Copy link

codecov bot commented Oct 9, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (551be65) 13.67% compared to head (7b9b594) 13.69%.
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #396      +/-   ##
==========================================
+ Coverage   13.67%   13.69%   +0.01%     
==========================================
  Files           8        8              
  Lines        1733     1731       -2     
  Branches       79       79              
==========================================
  Hits          237      237              
+ Misses       1496     1494       -2     
Flag Coverage Δ
sanity 16.54% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
library/blivet.py 0.00% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@richm richm changed the title Do not remove swap at every run fix: Do not remove swap at every run Oct 9, 2023
@richm
Copy link
Contributor

richm commented Oct 9, 2023

[citest]

@richm
Copy link
Contributor

richm commented Oct 10, 2023

well, the swap tests pass on el8 and el9 - as far as correctness I'll have to defer to @vojtechtrefny and @japokorn

@scaronni
Copy link
Contributor Author

Just to be clear, the blivet module removes the swap on the live system and then re-adds it back in the subsequent one, which means if a system is using swap heavily there might be some serious issues.

The swap is removed anyway correctly if people specify it as absent in the variables.

@vojtechtrefny
Copy link
Collaborator

The special condition for swap was added in #90 @dwlehman do you remember why? Looking at the code I don't see a reason for always removing the swap entry.

@dwlehman
Copy link
Collaborator

Sadly I do not have any record or memory of why to do that, but I think that if all the tests are passing this change is probably good.

@vojtechtrefny
Copy link
Collaborator

Sadly I do not have any record or memory of why to do that, but I think that if all the tests are passing this change is probably good.

Ok, I think we can merge this. The tests are passing and we definitely don't want to always remove and then re-add the swap entry and I don't see another reason for having this condition.

@richm richm merged commit 71b700b into linux-system-roles:main Oct 17, 2023
23 of 36 checks passed
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.

4 participants