Skip to content

Commit

Permalink
cli:state_diff: Display unknown interface type as 'other'
Browse files Browse the repository at this point in the history
That is to stay consistent with what we have in
cli/commands/status.py:_display_interface_header()
  • Loading branch information
slyon committed Feb 19, 2024
1 parent 6c4fa90 commit e6a7677
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions netplan_cli/cli/state_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,12 @@ def _analyze_missing_interfaces(self, report: dict) -> None:
for iface in netplan_only:
iface_type = self.netplan_state.netdefs.get(iface).type
report['missing_interfaces_system'][iface] = {
'type': DEVICE_TYPES.get(iface_type, 'unknown')
'type': DEVICE_TYPES.get(iface_type, 'other')
}

for iface in system_only:
report['missing_interfaces_netplan'][iface] = {
'type': system_state.get(iface).get('type', 'unknown'),
'type': system_state.get(iface).get('type', 'other'),
'index': system_state.get(iface).get('index'),
}

Expand Down Expand Up @@ -463,7 +463,7 @@ def _get_netplan_interfaces(self) -> dict:
iface[interface] = {'netplan_state': {'id': interface}}
iface_ref = iface[interface]['netplan_state']

iface_ref['type'] = DEVICE_TYPES.get(config.type, 'unknown')
iface_ref['type'] = DEVICE_TYPES.get(config.type, 'other')

iface_ref['dhcp4'] = config.dhcp4
iface_ref['dhcp6'] = config.dhcp6
Expand Down

0 comments on commit e6a7677

Please sign in to comment.