Skip to content

Commit b307a97

Browse files
committed
interface monitor default name
1 parent bd003d8 commit b307a97

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

mktxp/datasource/interface_ds.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,7 @@ def metric_records(router_entry, *, metric_labels = None, translation_table = No
119119
# combines names with comments
120120
interface_monitor_record['name'] = interface['comment'] if router_entry.config_entry.use_comments_over_names else \
121121
f"{interface['name']} ({interface['comment']})"
122-
elif interface_monitor_record.get('name') is None:
123-
interface_monitor_record['name'] = interface['name']
124-
122+
interface_monitor_record.setdefault('name', interface['name'])
125123
interface_monitor_records.append(interface_monitor_record)
126124

127125
# With wifiwave2, Mikrotik renamed the field 'registered-clients' to 'registered-peers'

0 commit comments

Comments
 (0)