def update(name, mac=None, mtu=None):
    '''
    Update a nictag

    name : string
        name of nictag
    mac : string
        optional new mac for nictag
    mtu : int
        optional new MTU for nictag

    CLI Example:

    .. code-block:: bash

        salt '*' nictagadm.update trunk mtu=9000
    '''
    ret = {}
    nictagadm = _check_nictagadm()
    dladm = _check_dladm()

    if name not in list_nictags():
        return {'Error': 'nictag {0} does not exists.'.format(name)}
    if not mtu and not mac:
        return {'Error': 'please provide either mac or/and mtu.'}
    if mtu:
        if 9000 > mtu or mtu < 1500:
            return {'Error': 'mtu must be a value between 1500 and 9000.'}
    if mac:
        if mac == 'etherstub':
            return {'Error': 'cannot update a nic with "etherstub".'}
        else:
            cmd = '{dladm} show-phys -m -p -o address'.format(
                dladm=dladm
            )
            res = __salt__['cmd.run_all'](cmd)
            if mac not in res['stdout'].splitlines():
                return {'Error': '{0} is not present on this system.'.format(mac)}

    if mac and mtu:
        properties = "mtu={0},mac={1}".format(mtu, mac)
    elif mac:
        properties = "mac={0}".format(mac) if mac else ""
    elif mtu:
        properties = "mtu={0}".format(mtu) if mtu else ""

    cmd = '{nictagadm} update -p {properties} {name}'.format(
        nictagadm=nictagadm,
        properties=properties,
        name=name
    )
    res = __salt__['cmd.run_all'](cmd)

    if res['retcode'] == 0:
        return True
    else:
        return {'Error': 'failed to update nictag.' if 'stderr' not in res and res['stderr'] == '' else res['stderr']}
dataset/ETHPy150Open saltstack/salt/salt/modules/smartos_nictagadm.py/update/swapped operands of `>`