Skip to content

Commit

Permalink
commands/diff: skip interfaces without diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
daniloegea committed Aug 2, 2023
1 parent 37d45c8 commit b14afd5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions netplan_cli/cli/commands/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ def print_table(self, diff: dict, **style: dict):
for iface, data in interfaces.items():
name = data.get('name')

# Skip interfaces without diff
if not data.get('system_state') and not data.get('netplan_state'):
continue

table = Table(expand=True, title=f'Interface: {name}\nNetplan ID: {iface}', **style)
table.add_column('Missing resources in Netplan\'s State', justify="center", ratio=2)
table.add_column('Missing resources in System\'s State', justify="center", ratio=2)
Expand Down

0 comments on commit b14afd5

Please sign in to comment.