def verify_capacity(capacity, obj_name):
    """
    :type capacity: int
    :param capacity: Capacity to check

    :type obj_name: str
    :param obj_name: Object name to chekc. Example: pool, volume, etc.

    :rtype: int
    :return: Fixed capacity format

    :raises: ValueError: Invalid capacity
    """
    capacity = int(capacity)
    if capacity < 1:
        raise ValueError(
            '{0} capacity must be >= 1 GB ("{1}" was given)'.format(obj_name,
                                                                    capacity))
    return capacity