Configure specified adapter to use EtherCAT adapter mode. If successful, the target will need reboot if it doesn't
    already use EtherCAT adapter mode, otherwise will return true.

    :param interface: interface label
    :param master_id: EtherCAT Master ID
    :return: True if the settings were applied, otherwise an exception will be thrown.

    CLI Example:

    .. code-block:: bash

        salt '*' ip.set_ethercat interface-label master-id

def set_ethercat(interface, master_id):
    '''
    Configure specified adapter to use EtherCAT adapter mode. If successful, the target will need reboot if it doesn't
    already use EtherCAT adapter mode, otherwise will return true.

    :param interface: interface label
    :param master_id: EtherCAT Master ID
    :return: True if the settings were applied, otherwise an exception will be thrown.

    CLI Example:

    .. code-block:: bash

        salt '*' ip.set_ethercat interface-label master-id
    '''
    if __grains__['lsb_distrib_id'] == 'nilrt':
        initial_mode = _get_adapter_mode_info(interface)
        _save_config(interface, 'Mode', NIRTCFG_ETHERCAT)
        _save_config(interface, 'MasterID', master_id)
        if initial_mode != 'ethercat':
            __salt__['system.set_reboot_required_witnessed']()
        return True
    raise salt.exceptions.CommandExecutionError('EtherCAT is not supported')