univention.appcenter.actions package

univention.appcenter.actions.possible_network_error(func)[source]
class univention.appcenter.actions.StoreAppAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Bases: argparse.Action

cache_class

alias of Apps

classmethod parse_app_id_string(app_id)[source]
classmethod get_app_from_app_id_string(app_id, app_version, ucs_version, server)[source]
class univention.appcenter.actions.UniventionAppActionMeta[source]

Bases: type

class univention.appcenter.actions.UniventionAppAction[source]

Bases: object

parent_logger = <logging.Logger object>
classmethod get_action_name()[source]
classmethod _log(logger, level, msg, *args, **kwargs)[source]
classmethod debug(msg, logger=None)[source]
classmethod log(msg, logger=None)[source]
classmethod warn(msg, logger=None)[source]
classmethod fatal(msg, logger=None)[source]
classmethod log_exception(exc, logger=None)[source]
setup_parser(parser)[source]
percentage
_build_namespace(_namespace=None, **kwargs)[source]
classmethod call_safe(**kwargs)[source]
classmethod call(**kwargs)[source]
call_with_namespace(namespace)[source]
_get_joinscript_path(app, unjoin=False)[source]
_call_cache_script(_app, _ext, *args, **kwargs)[source]
_call_script(_script, *args, **kwargs)[source]
_subprocess(args, logger=None, env=None)[source]
_send_information(*args, **kwargs)[source]
univention.appcenter.actions.get_action(action_name)[source]
univention.appcenter.actions.all_actions()[source]
univention.appcenter.actions._import()[source]

Submodules

univention.appcenter.actions.configure module

class univention.appcenter.actions.configure.Configure[source]

Bases: univention.appcenter.actions.UniventionAppAction

Configures an application.

help = 'Configure an app'
setup_parser(parser)[source]
main(args)[source]
classmethod list_config(app)[source]
_set_config(app, set_vars, args)[source]
_set_config_via_tool(app, set_vars)[source]
_run_configure_script(app, action)[source]
logger = <logging.Logger object>
progress = <logging.Logger object>

univention.appcenter.actions.credentials module

class univention.appcenter.actions.credentials.CredentialsAction[source]

Bases: univention.appcenter.actions.UniventionAppAction

setup_parser(parser)[source]
check_user_credentials(args)[source]
_get_username(args)[source]
_get_password(args, ask=True)[source]
_get_password_for(username)[source]
_get_password_file(*args, **kwds)[source]
_get_userdn(args)[source]
_get_machine_connection()[source]
_get_admin_connection()[source]
_get_ldap_connection(args, allow_machine_connection=False, allow_admin_connection=True)[source]

univention.appcenter.actions.domain module

class univention.appcenter.actions.domain.Domain[source]

Bases: univention.appcenter.actions.credentials.CredentialsAction

Shows information about the domain and enabled management of app installations.

help = 'Domain management'
setup_parser(parser)[source]
main(args)[source]
get_appcenter_hosts(lo, pos)[source]
manage(login, pwdfile, logger, *args)[source]
classmethod to_dict(apps)[source]
_get_installations(app, hosts, app_ldap_objects)[source]
_find_latest_app_version(app)[source]
logger = <logging.Logger object>
progress = <logging.Logger object>

univention.appcenter.actions.get module

class univention.appcenter.actions.get.StoreKeysAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Bases: argparse.Action

univention.appcenter.actions.get._match(value, pattern)[source]
class univention.appcenter.actions.get.Get[source]

Bases: univention.appcenter.actions.UniventionAppAction

Fetches meta information about the app.

help = 'Query an app'
setup_parser(parser)[source]
main(args)[source]
classmethod to_dict(app)[source]
classmethod _candidate_dict(app)[source]
classmethod raw_value(app, section, option)[source]
get_values(app, keys, warn=True)[source]
logger = <logging.Logger object>
progress = <logging.Logger object>

univention.appcenter.actions.info module

class univention.appcenter.actions.info.Info[source]

Bases: univention.appcenter.actions.UniventionAppAction

Shows information on the current state of the App Center itself.

help = 'Show general info'
setup_parser(parser)[source]
main(args)[source]
_as_json()[source]
_output()[source]
classmethod get_ucs_version()[source]
classmethod is_compatible(other_version, function=None)[source]
classmethod get_compatibility()[source]

Returns the version number of the App Center. As App Center within a domain may talk to each other it is necessary to ask whether they are compatible. The version number will rise whenever a change was made that may break compatibility.

1: initial app center 12/12 (not assigned, appcenter/version was not supported) 2: app center with remote installation 02/13 (not assigned, appcenter/version was not supported) 3: app center with version and only_dry_run 03/13 4: app center with docker support and new App class 11/15 Starting with UCS 4.3 (03/18): The full UCS version

get_installed_apps()[source]
get_upgradable_apps()[source]
logger = <logging.Logger object>
progress = <logging.Logger object>

univention.appcenter.actions.install module

exception univention.appcenter.actions.install.ControlScriptException[source]

Bases: exceptions.Exception

class univention.appcenter.actions.install.Install[source]

Bases: univention.appcenter.actions.install_base.InstallRemoveUpgrade

Installs an application from the Univention App Center.

help = 'Install an app'
prescript_ext = 'preinst'
pre_readme = 'readme_install'
post_readme = 'readme_post_install'
setup_parser(parser)[source]
main(args)[source]
_write_start_event(app, args)[source]
_write_success_event(app, context_id, args)[source]
_write_fail_event(app, context_id, status, args)[source]
_install_only_master_packages(args)[source]
_call_action_hooks(directory)[source]
_do_it(app, args)[source]
_install_packages(packages)[source]
_install_master_packages(app, unregister_if_uninstalled=False)[source]
_install_only_master_packages_remotely(app, host, is_master, args)[source]
_install_app(app, args)[source]
_revert(app, args)[source]
_dry_run(app, args)[source]
_install_packages_dry_run(app, args, with_dist_upgrade)[source]
_get_packages_for_dry_run(app, args)[source]
logger = <logging.Logger object>
progress = <logging.Logger object>

univention.appcenter.actions.install_base module

class univention.appcenter.actions.install_base.StoreConfigAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Bases: argparse.Action

class univention.appcenter.actions.install_base.InstallRemoveUpgrade[source]

Bases: univention.appcenter.actions.register.Register

prescript_ext = None
pre_readme = None
post_readme = None
setup_parser(parser)[source]
main = None
_write_start_event(app, args)[source]
_write_success_event(app, context_id, args)[source]
_write_fail_event(app, context_id, status, args)[source]
_call_action_hooks(directory)[source]

abstract method is empty, because there is no default hook for any action. The implementation has to be done in each derived class if needed.

_run_parts(directory)[source]

in order to call hooks we use run-parts, so that administrators can better comprehend what is done behind the scenes and test their script folders manually using that tool.

do_it(args)[source]
needs_credentials(app)[source]
_handle_errors(app, args, errors, fatal)[source]
_call_prescript(app, args, **kwargs)[source]
_revert(app, args)[source]
_do_it(app, args)[source]
_show_license(app, args)[source]
_show_pre_readme(app, args)[source]
_show_post_readme(app, args)[source]
_show_file(app, attr, args, confirm=False, agree=False)[source]
_call_unjoin_script(app, args)[source]
_call_join_script(app, args, unjoin=False)[source]
_get_configure_settings(app, filter_action=True)[source]
_update_certificates(app, args)[source]
_configure(app, args, run_script=None)[source]
_reload_apache()[source]
dry_run(app, args)[source]
_dry_run(app, args)[source]

univention.appcenter.actions.list_apps module

class univention.appcenter.actions.list_apps.List[source]

Bases: univention.appcenter.actions.UniventionAppAction

Lists all available apps; shows installed version.

help = 'List all apps'
setup_parser(parser)[source]
main(args)[source]
classmethod get_apps()[source]
classmethod _blacklist_includes_app(the_list, app)[source]
_list(pattern)[source]
logger = <logging.Logger object>
progress = <logging.Logger object>

univention.appcenter.actions.register module

class univention.appcenter.actions.register.Register[source]

Bases: univention.appcenter.actions.credentials.CredentialsAction

Registers one or more applications. Done automatically via install, only useful if something went wrong / finer grained control is needed.

help = 'Registers an app'
setup_parser(parser)[source]
main(args)[source]
_do_register(app, args)[source]
_shall_register(args, task)[source]
_register_component_for_apps(apps, args)[source]
_register_component(app, delay=False)[source]
_register_component_dict(app)[source]
_unregister_component(app)[source]
_unregister_component_dict(app)[source]
_register_files_for_apps(apps, args)[source]
_register_files(app)[source]
_unregister_files(app)[source]
_register_attributes_for_apps(apps, args)[source]
_register_attributes(app, args)[source]
_unregister_attributes(app, args)[source]
_register_listener_for_apps(apps, args)[source]
_register_listener(app, delay=False)[source]
_update_converter_service(app)[source]
_unregister_listener(app, delay=False)[source]
_restart_listener(meta_files)[source]
_register_host_for_apps(apps, args)[source]
_register_host(app, args)[source]
_unregister_host(app, args)[source]
_register_app_for_apps(apps, args)[source]
_register_app(app, args, lo=None, pos=None, delay=False)[source]
_register_database_for_apps(apps, args)[source]
_register_database(app)[source]
_register_docker_variables(app)[source]
_register_ports(app)[source]
_register_app_report_variables(app)[source]
_register_overview_variables(app)[source]
_unregister_app(app, args, lo=None, pos=None, delay=False)[source]
_register_installed_apps_in_ucr()[source]
logger = <logging.Logger object>
progress = <logging.Logger object>

univention.appcenter.actions.remove module

class univention.appcenter.actions.remove.Remove[source]

Bases: univention.appcenter.actions.install_base.InstallRemoveUpgrade

Removes an application from the Univention App Center.

help = 'Uninstall an app'
prescript_ext = 'prerm'
pre_readme = 'readme_uninstall'
post_readme = 'readme_post_uninstall'
main(args)[source]
_show_license(app, args)[source]
_do_it(app, args)[source]
_write_start_event(app, args)[source]
_write_success_event(app, context_id, args)[source]
_write_fail_event(app, context_id, status, args)[source]
_call_action_hooks(directory)[source]
needs_credentials(app)[source]
_remove_app(app, args)[source]
_dry_run(app, args)[source]
logger = <logging.Logger object>
progress = <logging.Logger object>

univention.appcenter.actions.stall module

class univention.appcenter.actions.stall.Stall[source]

Bases: univention.appcenter.actions.UniventionAppAction

Disbales updates for this app. Useful for suppressing warnings when an app reached its end of life but shall still be used.

help = 'Stalls an app'
setup_parser(parser)[source]
main(args)[source]
_undo_stall(app)[source]
_stall(app)[source]
logger = <logging.Logger object>
progress = <logging.Logger object>

univention.appcenter.actions.update module

class univention.appcenter.actions.update.Update[source]

Bases: univention.appcenter.actions.UniventionAppAction

Updates the list of all available applications by asking the App Center server

help = 'Updates the list of apps'
setup_parser(parser)[source]
main(args)[source]
get_app_info(app)[source]
_appcenter_caches(args)[source]
_app_caches(args)[source]
_get_etags(etags_file)[source]
_save_etags(cache, etags)[source]
_download_supra_files(appcenter_cache)[source]
_download_files(cache, filenames)[source]
_verify_file(fname)[source]
_download_apps(app_cache)[source]
_download_file(*args, **kwargs)[source]
_update_local_files()[source]
_get_conffiles()[source]
_update_conffiles()[source]
_get_local_archive(app_cache)[source]
_extract_local_archive(app_cache)[source]
_uncompress_archive(app_cache, local_archive)[source]
_extract_archive(app_cache)[source]
_load_index_json(app_cache)[source]
logger = <logging.Logger object>
progress = <logging.Logger object>

univention.appcenter.actions.update_certificates module

class univention.appcenter.actions.update_certificates.UpdateCertificates[source]

Bases: univention.appcenter.actions.UniventionAppAction

Update certificates for an application.

help = 'Update certificates for an app'
setup_parser(parser)[source]
update_certificates(app)[source]
main(args)[source]
_run_update_certificates_script(app)[source]
logger = <logging.Logger object>
progress = <logging.Logger object>

univention.appcenter.actions.update_check module

class univention.appcenter.actions.update_check.checkUCSVersion(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Bases: argparse.Action

class univention.appcenter.actions.update_check.UpdateCheck[source]

Bases: univention.appcenter.actions.UniventionAppAction

Check if update to next ucs minor version is possible with the locally installed apps

For docker apps check if is available in next UCS version. For package based apps check if there is an app version with the same component in the next UCS version

help = 'Check for all locally installed Apps if they are available in the next UCS version'
setup_parser(parser)[source]
classmethod app_can_update(app, next_version, next_apps)[source]

checks if update is possible for this app docker apps have to support the next version components must be available in the next version component id of package based app must be available in the next version

classmethod get_blocking_apps(ucs_version)[source]

checks if update is possible for this app

main(args)[source]
logger = <logging.Logger object>
progress = <logging.Logger object>

univention.appcenter.actions.upgrade module

class univention.appcenter.actions.upgrade.Upgrade[source]

Bases: univention.appcenter.actions.install.Install

Upgrades an installed application from the Univention App Center.

help = 'Upgrade an app'
pre_readme = 'readme_update'
post_readme = 'readme_post_update'
setup_parser(parser)[source]
_app_too_old(current_app, specified_app)[source]
main(args)[source]
_write_start_event(app, args)[source]
_write_success_event(app, context_id, args)[source]
_write_fail_event(app, context_id, status, args)[source]
_call_action_hooks(directory)[source]
needs_credentials(app)[source]
_revert(app, args)[source]
_show_license(app, args)[source]
_call_prescript(app, args)[source]
_send_information(app, status, value=None)[source]
_install_packages(packages)[source]
classmethod iter_upgradable_apps()[source]
_dry_run(app, args)[source]
logger = <logging.Logger object>
progress = <logging.Logger object>