Esempio n. 1
0
def series_upgrade_prepare():
    set_unit_upgrading()
    # HA services are shutdown when the unit receives series upgrade
    # notifications from peers so cannot pause services.
    if not is_unit_paused_set() and not is_waiting_unit_series_upgrade_set():
        pause_unit()
    notify_peers_of_series_upgrade()
    # mark crmsh package as manually installed
    # so it does not get uninstalled on release upgrade
    # from xenial to bionic
    apt_mark('crmsh', 'manual')
def remove_old_packages():
    '''Purge any packages that need ot be removed.

    :returns: bool Whether packages were removed.
    '''
    installed_packages = filter_missing_packages(determine_purge_packages())
    if installed_packages:
        apt_mark(filter_missing_packages(determine_held_packages()), 'auto')
        apt_purge(installed_packages, fatal=True)
        apt_autoremove(purge=True, fatal=True)
    return bool(installed_packages)
def remove_old_packages():
    '''Purge any packages that need ot be removed.

    :returns: bool Whether packages were removed.
    '''
    installed_packages = filter_missing_packages(determine_purge_packages())
    if installed_packages:
        apt_mark(filter_missing_packages(determine_held_packages()),
                 'auto')
        apt_purge(installed_packages, fatal=True)
        apt_autoremove(purge=True, fatal=True)
    return bool(installed_packages)