def _get_volume_creation_time(volume):
    """
    Extract the creation time from an AWS or Rackspace volume.

    XXX: libcloud doesn't represent volume creation time uniformly across
    drivers.  Thus this method only works on drivers specifically accounted
    for. Should be extended or refactored for GCE support.

    :param libcloud.compute.base.StorageVolume volume: The volume to query.
    :returns: The datetime when the ``volume`` was created.
    """
    try:
        # AWS
        return volume.extra['create_time']
    except __HOLE__:
        # Rackspace.  Timestamps have no timezone indicated.  Manual
        # experimentation indicates timestamps are in UTC (which of course
        # is the only reasonable thing).
        return parse_date(
            volume.extra['created_at']
        ).replace(tzinfo=tzutc())
dataset/ETHPy150Open ClusterHQ/flocker/admin/cleanup.py/_get_volume_creation_time