Skip to content

Conversation

JanaHoch
Copy link
Contributor

@JanaHoch JanaHoch commented Sep 6, 2025

SUMMARY

Added new module proxmox_subnet to create/update/delete subnets in proxmox SDN

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

proxmox_subnet

ADDITIONAL INFORMATION

This is part of #30
Note: If you are trying to test this. it needs sdn locking functions which I've added in #176

Copy link

codecov bot commented Sep 8, 2025

Codecov Report

❌ Patch coverage is 86.84211% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.61%. Comparing base (b190cb3) to head (e0792e2).

Files with missing lines Patch % Lines
plugins/modules/proxmox_subnet.py 81.20% 19 Missing and 9 partials ⚠️
tests/unit/plugins/modules/test_proxmox_subnet.py 97.46% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #181      +/-   ##
==========================================
+ Coverage   64.86%   65.61%   +0.75%     
==========================================
  Files          69       71       +2     
  Lines        6941     7169     +228     
  Branches     1326     1361      +35     
==========================================
+ Hits         4502     4704     +202     
- Misses       2226     2239      +13     
- Partials      213      226      +13     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JanaHoch JanaHoch marked this pull request as draft September 10, 2025 05:14
@JanaHoch JanaHoch marked this pull request as ready for review September 28, 2025 02:41
@JanaHoch
Copy link
Contributor Author

Hi @IamLunchbox can you Please also check this. @Thulium-Drake this also needs that function from #183

@JanaHoch
Copy link
Contributor Author

JanaHoch commented Sep 28, 2025

Just for reference, when I was thinking through for update method I created this flow chart with the help of GPT to better visualize. This might not be exactly same as the final code (I created this before writing it)but still it should give general idea of what I was trying.
mermaid-diagram-2x

@Thulium-Drake
Copy link
Collaborator

@JanaHoch I have updated this one as well with #183 in it! :-)

@IamLunchbox
Copy link
Contributor

The flow chart is kind of daunting 😆

But I'll check this PR and #182 out in the immediate future, to not keep the next release waiting! 😁

@JanaHoch
Copy link
Contributor Author

JanaHoch commented Oct 6, 2025

The flow chart is kind of daunting 😆

But I'll check this PR and #182 out in the immediate future, to not keep the next release waiting! 😁

Yeah flow chart looks bit complicated but basically I'm doing checks in 2 stages
stage 1 - check all other parameters for subnet except dhcp_range. this will tell usif parameters needs to be updated or if this is a complete new subnet

stage 2 - chek dhcp_range. this will tell us if user has supplied any new range which are not already present and if any of them partially overlap with existing one

to decide what to do with dhcp range we have another parameter dhcp_range_update_mode

If there is partial overlap and mode is overwrite we overwrite if it is append we error out

If no overlap and mode is append/overwrite we append/overwrite dhcp and update other parameters as needed

If user didn't give any range and if mode is append we just ignore existing ranges. or if mode is overwrite we delete with delete=dhcp_range. default is always append so it won't accidentally delete.
let me know if you think instead of deleting in this it would be just better to warn user or fail and make sure they have to explicitly send delete=dhcp_range

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.

3 participants