Changeset 14408 in genesis for tools


Ignore:
Timestamp:
Dec 16, 2019, 8:49:59 PM (5 years ago)
Author:
rick
Message:

Add extra devices in motd listing for quick access

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/gformat.py

    r14384 r14408  
    11151115    ifacedump = datadump[iface_key]
    11161116
    1117     if not 'ns_ip' in ifacedump:
     1117    if 'mac' in ifacedump:
     1118      x_ip = ifacedump['ip'].split('/')[0]
     1119      x_mode = 'active' if ifacedump.get('status') == 'up' else 'disabled'
     1120    elif 'ns_ip' in ifacedump:
     1121      x_ip = ifacedump['ns_ip'].split('/')[0]
     1122      x_mode = ifacedump.get('mode') or 'unknown'
     1123    else:
    11181124      continue
    11191125
    1120     x_ip = ifacedump['ns_ip'].split('/')[0]
    1121 
    1122     if 'mode' in ifacedump:
    1123       x_mode = ifacedump['mode']
    1124     else:
    1125       x_mode = 'unknown'
    1126 
    1127     if 'bridge_type' in ifacedump:
    1128       device_type = ifacedump['bridge_type']
    1129     else:
    1130       device_type = 'Unknown'
    1131 
    1132     table.append((ifacedump['autogen_iface'], x_mode, 'http://%s' % x_ip if url else x_ip, device_type))
     1126    device_type = ifacedump.get('bridge_type') or 'Unknown'
     1127    table.append((ifacedump['autogen_iface'], x_mode, 'http://%s' % x_ip if url else x_ip, "%s (%s)" % (device_type, ifacedump.get('comment',''))))
     1128
    11331129  return table
    11341130
     
    13771373    ('ns_mac', False),
    13781374    ('bullet2_mac', False),
     1375    ('mac', False),
    13791376    ('ns_type', False),
    13801377    ('bridge_type', False),
Note: See TracChangeset for help on using the changeset viewer.