def check_protected_from_update(object, data):
    if object.is_protected and data.get('is_protected', True):
        # Okay, the only thing we can allow here is a change
        # to 'is_public', so we have to make sure no other values
        # are changing
        if data in 'is_public':
            obj = object.to_dict()
            if all(k == 'is_public' or (
                    k in obj and obj[k] == v) for k, v in six.iteritems(data)):
                return

        raise ex.UpdateFailedException(
            object.id,
            _("{object} with id '%s' could not be updated "
              "because it's marked as protected").format(
                object=type(object).__name__))
dataset/ETHPy150Open openstack/sahara/sahara/service/validations/acl.py/check_protected_from_update/swapped operands of `in`