Пример #1
0
def _get_url():
    """Return the web client URL based on Cockpit version."""
    process = subprocess.run(
        ['dpkg-query', '--showformat=${Version}', '--show', 'cockpit'],
        stdout=subprocess.PIPE)
    cockpit_version = process.stdout.decode()
    if Version(cockpit_version) >= Version('235'):
        url = '/_cockpit/metrics'
    else:
        url = '/_cockpit/system/graphs'

    return url
Пример #2
0
def force_upgrade(helper, packages):
    """Force upgrade mumble-server to resolve conffile prompts."""
    if 'mumble-server' not in packages:
        return False

    # Allow upgrades within 1.3.*
    package = packages['mumble-server']
    if Version(package['new_version']) > Version('1.4~'):
        return False

    helper.install(['mumble-server'], force_configuration='new')
    helper.call('post', actions.superuser_run, 'mumble', ['setup'])
    return True
Пример #3
0
def force_upgrade(helper, packages):
    """Force update package to resolve conffile prompts."""
    if 'tt-rss' not in packages:
        return False

    # Allow tt-rss any lower version to upgrade to 21.*
    package = packages['tt-rss']
    if Version(package['new_version']) > Version('22~'):
        return False

    helper.install(['tt-rss'], force_configuration='new')
    actions.superuser_run('ttrss', ['setup'])
    return True
Пример #4
0
def force_upgrade(helper, packages):
    """Force upgrade package to resolve conffile prompts."""
    if 'roundcube-core' not in packages:
        return False

    # Allow roundcube any lower version to upgrade to 1.4.*
    package = packages['roundcube-core']
    if Version(package['new_version']) > Version('1.5~'):
        return False

    helper.install(['roundcube-core'], force_configuration='new')
    actions.superuser_run('roundcube', ['setup'])
    return True
Пример #5
0
def force_upgrade(helper, packages):
    """Force upgrade firewalld to resolve conffile prompts."""
    if 'firewalld' not in packages:
        return False

    # firewalld 0.6.x -> 0.7.x, 0.6.x -> 0.8.x, 0.7.x -> 0.8.x
    package = packages['firewalld']
    if Version(package['current_version']) >= Version('0.9') or \
       Version(package['new_version']) < Version('0.7'):
        return False

    helper.install(['firewalld'], force_configuration='new')
    _run_setup()
    return True
Пример #6
0
def force_upgrade(helper, packages):
    """Force upgrade radicale to resolve conffile prompt."""
    if 'radicale' not in packages:
        return False

    # Allow upgrade from 2.* to newer 2.* and 3.*
    package = packages['radicale']
    if Version(package['new_version']) > Version('4~'):
        return False

    rights = get_rights_value()
    helper.install(['radicale'], force_configuration='new')
    actions.superuser_run('radicale', ['configure', '--rights_type', rights])

    return True
Пример #7
0
def force_upgrade(helper, packages):
    """Force upgrade minidlna to resolve conffile prompt."""
    if 'minidlna' not in packages:
        return False

    # Allow upgrade from 1.2.1+dfsg-1+b1 to 1.3.x
    package = packages['minidlna']
    if Version(package['new_version']) > Version('1.4~'):
        return False

    media_dir = get_media_dir()
    helper.install(['minidlna'], force_configuration='new')
    set_media_dir(media_dir)

    return True
Пример #8
0
def force_upgrade(helper, packages):
    """Force upgrade matrix-synapse to resolve conffile prompt."""
    if 'matrix-synapse' not in packages:
        return False

    # Allow any lower version to upgrade to 1.15.*
    package = packages['matrix-synapse']
    if Version(package['new_version']) > Version('1.16~'):
        return False

    public_registration_status = get_public_registration_status()
    helper.install(['matrix-synapse'], force_configuration='new')
    actions.superuser_run('matrixsynapse', ['post-install'])
    if public_registration_status:
        actions.superuser_run('matrixsynapse',
                              ['public-registration', 'enable'])

    return True