MitchellGulledge / Meraki-vWAN

5 stars 4 forks source link

Script does not work with combined Meraki networks #3

Closed MitchellGulledge closed 4 years ago

MitchellGulledge commented 4 years ago

below is the section of code to get network devices to later validate firmware. Need to build logic to accommodate for combined networks. devices = mdashboard.devices.getNetworkDevices(network_info) xdevices = devices[0]

yujiterada commented 4 years ago

Need to verify functionality with HA setup.

Possible Implementation

def get_mx_from_network_devices(network_devices: list):
    '''
    Returns only the MX information obtained from
    mdashboard.devices.getNetworkDevices(). If it does not exist,
    return None.

    @param network_devices: mdashboard.devices.getNetworkDevices().
    @rtype:   dict
    @return:  information of the MX.
    '''
    for network_device in network_devices:
        if network_device['model'][0:2] == 'MX':
            return network_device
    return None

# get device info
devices = mdashboard.devices.getNetworkDevices(network_info)
xdevices = get_mx_from_network_devices(devices)
yujiterada commented 4 years ago

yujiterada/Meraki-vWAN@93788e2c0ddef12aea643f9bef5ae1a93bd0aabc yujiterada/Meraki-vWAN@a1b3f4e28f8ac45fcdafda874be0cb2760e71132

JackStromberg commented 4 years ago

Fixed in 8604a11deeaab40ca9e14e0f14ea2c4aab4d895b