diff --git a/repos/system_upgrade/common/libraries/rpms.py b/repos/system_upgrade/common/libraries/rpms.py index 968cab94ea..e9c7b7d7ec 100644 --- a/repos/system_upgrade/common/libraries/rpms.py +++ b/repos/system_upgrade/common/libraries/rpms.py @@ -37,9 +37,9 @@ class LeappComponents(object): } } -_LEAPP_DEFAULT_COMPONENTS = frozenset((LeappComponents.FRAMEWORK, - LeappComponents.REPOSITORY, - LeappComponents.TOOLS)) +GET_LEAPP_PACKAGES_DEFAULT_COMPONENTS = frozenset((LeappComponents.FRAMEWORK, + LeappComponents.REPOSITORY, + LeappComponents.TOOLS)) def get_installed_rpms(): @@ -203,7 +203,7 @@ def _get_leapp_packages_of_type(major_version, component, type_='pkgs'): return sorted(res) -def get_leapp_packages(major_version=None, component=_LEAPP_DEFAULT_COMPONENTS): +def get_leapp_packages(major_version=None, component=GET_LEAPP_PACKAGES_DEFAULT_COMPONENTS): """ Get list of leapp packages. @@ -212,6 +212,15 @@ def get_leapp_packages(major_version=None, component=_LEAPP_DEFAULT_COMPONENTS): :param component: a list or a single enum value specifying leapp components (use enum :class: LeappComponents) If defined then only packages related to the specific component(s) will be returned. + The default set of components is in `GET_LEAPP_PACKAGES_DEFAULT_COMPONENTS` and + simple modifications of the default can be achieved with code like: + + .. code-block:: python + get_leapp_packages( + component=GET_LEAPP_PACKAGES_DEFAULT_COMPONENTS.difference( + [LeappComponents.TOOLS] + )) + :raises ValueError: if a requested component or major_version doesn't exist. .. note:: @@ -224,7 +233,7 @@ def get_leapp_packages(major_version=None, component=_LEAPP_DEFAULT_COMPONENTS): return _get_leapp_packages_of_type(major_version, component, type_="pkgs") -def get_leapp_dep_packages(major_version=None, component=_LEAPP_DEFAULT_COMPONENTS): +def get_leapp_dep_packages(major_version=None, component=GET_LEAPP_PACKAGES_DEFAULT_COMPONENTS): """ Get list of leapp dep metapackages. @@ -233,6 +242,14 @@ def get_leapp_dep_packages(major_version=None, component=_LEAPP_DEFAULT_COMPONEN :param component: a list or a single enum value specifying leapp components (use enum :class: LeappComponents) If defined then only packages related to the specific component(s) will be returned. + The default set of components is in `GET_LEAPP_PACKAGES_DEFAULT_COMPONENTS` and + simple modifications of the default can be achieved with code like: + + .. code-block:: python + get_leapp_packages( + component=GET_LEAPP_PACKAGES_DEFAULT_COMPONENTS.difference( + [LeappComponents.TOOLS] + )) :raises ValueError: if a requested component or major_version doesn't exist. """ return _get_leapp_packages_of_type(major_version, component, type_="deps")