def os_release(package, base='essex', reset_cache=False):
    '''
    Returns OpenStack release codename from a cached global.

    If reset_cache then unset the cached os_release version and return the
    freshly determined version.

    If the codename can not be determined from either an installed package or
    the installation source, the earliest release supported by the charm should
    be returned.
    '''
    global _os_rel
    if reset_cache:
        reset_os_release()
    if _os_rel:
        return _os_rel
    _os_rel = (
        get_os_codename_package(package, fatal=False) or
        get_os_codename_install_source(config('openstack-origin')) or
        base)
    return _os_rel
Returns OpenStack release codename from a cached global.

    If reset_cache then unset the cached os_release version and return the
    freshly determined version.

    If the codename can not be determined from either an installed package or
    the installation source, the earliest release supported by the charm should
    be returned.