Skip to content

Commit

Permalink
cli/status: add netplan status --diff
Browse files Browse the repository at this point in the history
netplan status --diff will use the state_diff module to output
inconsistencies in the network configuration.

status: split display in multiple methods

status: refactoring: fix typo and drop unused code

status: refactor _display_routes

Drop unused code and make use of the new route table name lookup.

tests: add a test file for netplan status --diff

tests: add some shallow cli tests

All the output tests are in test_status_diff. Adding some very shallow
cli tests for coverage sake.

status/diff: use the unspecified address to for missing DHCP addresses

Instead of "Missing DHCP address" it will show "0.0.0.0/0 (dhcp)" for
IPv4 and "::/0 (dhcp)" for IPv6.

status/diff: make it work with a single targeted interface

netplan status --diff <interface> will only display the configuration
for a single interface.

status/diff: mute field names as well when there is no diff

status/diff: make json/yaml output work with a single targeted interface

netplan status --diff -f json <interface> will only display the
configuration for a single interface.

status: refactoring

Move common code to a single place and drop duplication.

Don't display a linebreak in the end of the output.

Some minor code style changes.

cli:status: _get_missing_property_str to return '' in failure case

cli:status: avoid showing a MISSING state
  • Loading branch information
daniloegea authored and slyon committed Feb 19, 2024
1 parent e6a7677 commit 19917d7
Show file tree
Hide file tree
Showing 5 changed files with 2,001 additions and 136 deletions.
Loading

0 comments on commit 19917d7

Please sign in to comment.