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

nm: Fix converting memory-only profile to persistent #1256

Merged
merged 1 commit into from Aug 3, 2020

Conversation

cathay4t
Copy link
Member

@cathay4t cathay4t commented Aug 3, 2020

When converting memory-only profile to persistent using simple desire
state with state: up only, the memory only profile will not be
converted to persistent.

This is caused by nm/applier.py skip profile creation if desire state
is only state: up.

The fix is checking whether current profile's persistent state is equal
to desired.

Integration test case added.

@packit-as-a-service
Copy link

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/nmstate-nmstate-1256
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

@codecov
Copy link

codecov bot commented Aug 3, 2020

Codecov Report

Merging #1256 into master will decrease coverage by 0.03%.
The diff coverage is 20.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1256      +/-   ##
==========================================
- Coverage   57.65%   57.61%   -0.04%     
==========================================
  Files          56       56              
  Lines        5174     5179       +5     
==========================================
+ Hits         2983     2984       +1     
- Misses       2191     2195       +4     
Impacted Files Coverage Δ
libnmstate/nm/applier.py 14.78% <ø> (ø)
libnmstate/nm/connection.py 38.81% <20.00%> (-0.32%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d68832f...e384362. Read the comment docs.

Copy link
Member

@ffmancera ffmancera left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

When converting memory-only profile to persistent using simple desire
state with `state: up` only, the memory only profile will not be
converted to persistent.

This is caused by `nm/applier.py` skip profile creation if desire state
is only `state: up`.

The fix is checking whether current profile's persistent state is equal
to desired.

Integration test case added.

Signed-off-by: Gris Ge <fge@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants