Skip to content

Commit

Permalink
status/diff: mute field names as well when there is no diff
Browse files Browse the repository at this point in the history
  • Loading branch information
daniloegea committed Feb 6, 2024
1 parent 6d7d734 commit 89ef0da
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions netplan_cli/cli/commands/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def _display_interface_header(self, ifname: str, data):
format = '{sign} [{col}]●[/{col}] {idx:>2}: [green][highlight]{name} {type}'
format += ' [{col}]{state}[/{col}] ({backend}{netdef})[/highlight][/green]'
else:
format = ' [{col}]●[/{col}] {idx:>2}: [muted]{name} {type} {state} ({backend}{netdef})[/muted]'
format = ' [muted]● {idx:>2}: {name} {type} {state} ({backend}{netdef})[/muted]'
netdef = ': {}'.format(data.get('id')) if data.get('id') else ''

if not self.diff_only or self._has_diff(ifname):
Expand All @@ -318,7 +318,7 @@ def _display_mac_address(self, ifname: str, data):
format = '{title:>'+self.PAD+'} {mac}[muted]{vendor}[/muted]'
sign = ''
if self.diff and not missing_system_macaddress:
format = ' {title:>'+self.PAD+'} [muted]{mac}{vendor}[/muted]'
format = ' [muted]{title:>'+self.PAD+'} {mac}{vendor}[/muted]'
if self.diff_only:
hide_macaddress = True
elif self.diff and missing_system_macaddress:
Expand Down Expand Up @@ -364,7 +364,7 @@ def _display_ip_addresses(self, ifname: str, data):

address = f'{ip}/{prefix}'
if self.diff and address not in missing_netplan_addresses:
format = ' {title:>'+self.PAD+'} {start}[muted]{ip}/{prefix}{end}{extra}[/muted]'
format = ' [muted]{title:>'+self.PAD+'} {start}{ip}/{prefix}{end}{extra}[/muted]'
highlight_start = ''
highlight_end = ''
if self.diff_only:
Expand Down Expand Up @@ -420,7 +420,7 @@ def _display_dns_addresses(self, ifname: str, data):
sign = ''
hide_nameserver = False
if self.diff and val not in missing_netplan_nameservers:
format = ' {title:>'+self.PAD+'} [muted]{value}[/muted]'
format = ' [muted]{title:>'+self.PAD+'} {value}[/muted]'
highlight_start = ''
highlight_end = ''
if self.diff_only:
Expand Down Expand Up @@ -465,7 +465,7 @@ def _display_dns_search(self, ifname, data):
sign = ''
hide_search = False
if self.diff and val not in missing_netplan_search:
format = ' {title:>'+self.PAD+'} [muted]{value}[/muted]'
format = ' [muted]{title:>'+self.PAD+'} {value}[/muted]'
highlight_start = ''
highlight_end = ''
if self.diff_only:
Expand Down Expand Up @@ -548,7 +548,7 @@ def _display_routes(self, ifname, data):

sign = ''
if self.diff and route not in missing_netplan_routes:
format = ' {title:>'+self.PAD+'} [muted]{start}{to}{via}{src}{metric}{table}{end}{extra}[/muted]'
format = ' [muted]{title:>'+self.PAD+'} {start}{to}{via}{src}{metric}{table}{end}{extra}[/muted]'
default_start = ''
default_end = ''
if self.diff_only:
Expand Down Expand Up @@ -620,7 +620,7 @@ def _display_bridge(self, ifname, data):
sign = ''
hide_bridge = False
if self.diff and not missing_netplan_bridge_link:
format = ' {title:>'+self.PAD+'} [muted]{value}[/muted]'
format = ' [muted]{title:>'+self.PAD+'} {value}[/muted]'
if self.diff_only:
hide_bridge = True
elif self.diff and missing_netplan_bridge_link:
Expand Down Expand Up @@ -651,7 +651,7 @@ def _display_bond(self, ifname, data):
sign = ''
hide_bond = False
if self.diff and not missing_netplan_bond_link:
format = ' {title:>'+self.PAD+'} [muted]{value}[/muted]'
format = ' [muted]{title:>'+self.PAD+'} {value}[/muted]'
if self.diff_only:
hide_bond = True
elif self.diff and missing_netplan_bond_link:
Expand Down Expand Up @@ -682,7 +682,7 @@ def _display_vrf(self, ifname, data):
sign = ''
hide_vrf = False
if self.diff and not missing_netplan_vrf_link:
format = ' {title:>'+self.PAD+'} [muted]{value}[/muted]'
format = ' [muted]{title:>'+self.PAD+'} {value}[/muted]'
if self.diff_only:
hide_vrf = True
elif self.diff and missing_netplan_vrf_link:
Expand Down Expand Up @@ -714,7 +714,7 @@ def _display_members(self, ifname: str, data):
sign = ''
hide_member = False
if self.diff and val not in missing_netplan_interfaces:
format = ' {title:>'+self.PAD+'} [muted]{value}[/muted]'
format = ' [muted]{title:>'+self.PAD+'} {value}[/muted]'
highlight_start = ''
highlight_end = ''
if self.diff_only:
Expand Down

0 comments on commit 89ef0da

Please sign in to comment.