def _key_enabled(key_metadata, enabled, region, key, keyid, profile):
    ret = {'result': True, 'comment': '', 'changes': {}}
    kms_key_id = key_metadata['KeyId']
    if key_metadata['Enabled'] == enabled:
        return ret
    if __opts__['test']:
        ret['comment'] = 'Key set to have enabled status updated.'
        ret['result'] = None
        return ret
    if enabled:
        re = __salt__['boto_kms.enable_key'](
            kms_key_id, region, key, keyid, profile
        )
        event = 'Enabled'
    else:
        re = __salt__['boto_kms.disable_key'](
            kms_key_id, region, key, keyid, profile
        )
        event = 'Disabled'
    if re in 'error':
        msg = 'Failed to update key enabled status: {0}.'
        ret['result'] = False
        ret['comment'] = msg.format(re['error']['message'])
    else:
        ret['comment'] = '{0} key.'.format(event)
    return ret
dataset/ETHPy150Open saltstack/salt/salt/states/boto_kms.py/_key_enabled/swapped operands of `in`