Page MenuHomeDevCentral

Compute CIDR prefix from netmask for RHEL network scripts
ClosedPublic

Authored by dereckson on Mar 5 2022, 10:56.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 10:01
Unknown Object (File)
Thu, Nov 14, 07:50
Unknown Object (File)
Wed, Nov 13, 01:08
Unknown Object (File)
Tue, Nov 12, 19:14
Unknown Object (File)
Tue, Nov 12, 16:47
Unknown Object (File)
Mon, Nov 11, 12:28
Unknown Object (File)
Sun, Nov 10, 04:56
Unknown Object (File)
Wed, Nov 6, 12:40
Subscribers
None

Details

Summary

The network scripts use a CIDR notation like PREFIX=24
instead of a netmask notation.

Salt offers a cidr_to_ipv4_netmask but not the other way
around, so a new network execution module is offered.

This is a follow-up for f9dbdab3b579.

Test Plan

Unit tests are provided for network module

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Errors
SeverityLocationCodeMessage
Error_tests/modules/test_network.py:11E731flake8 E731
Error_tests/modules/test_rust.py:9E302flake8 E302
Unit
No Test Coverage
Branch
main
Build Status
Buildable 4022
Build 4274: arc lint + arc unit

Event Timeline

dereckson created this revision.

Remove fix to Rust tests from this change

Allow to detect netmask in the configuration is invalid

network is already the name of an execution module:
https://docs.saltproject.io/en/latest/ref/modules/all/salt.modules.network.html

Probably cool to rename it, even if Salt is happy to let us replace modules like that.

Avoid to shadow network execution module

This revision is now accepted and ready to land.Mar 7 2022, 19:31