From: Kobi Ginon Date: Wed, 20 May 2026 13:09:53 +0000 (+0300) Subject: ceph.spec: declare PyYAML and Jinja2 Requires for cephadm RPM X-Git-Tag: v21.0.1~6^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=33c1d671dea1cfe92e76a2d8dae649976ff22bf2;p=ceph.git ceph.spec: declare PyYAML and Jinja2 Requires for cephadm RPM cephadm's zipapp imports yaml and jinja2. When the package is built with cephadm_bundling and RPM-sourced deps (--without cephadm_pip_deps), only BuildRequires were listed for jinja2 and no runtime Requires were declared for PyYAML or Jinja2, so minimal "dnf install cephadm" could fail with ModuleNotFoundError. The unbundled cephadm case also lacked PyYAML. Add matching BuildRequires/Requires in the rpm-bundle branch and Requires (plus SUSE naming for Jinja2/PyYAML) in the no-bundle branch. Fixes: https://tracker.ceph.com/issues/75389 Signed-off-by: Kobi Ginon --- diff --git a/ceph.spec.in b/ceph.spec.in index 18cd57b2683..b170edf93f7 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -558,13 +558,39 @@ Requires: which %if 0%{?weak_deps} Recommends: podman >= 2.0.2 %endif +# Cephadm zipapp: CMake sets CEPHADM_BUNDLED_DEPENDENCIES to pip, rpm, or none +# (see build / cmake block below): +# - with cephadm_bundling, with cephadm_pip_deps: pip at build, no stanzas here +# - with cephadm_bundling, without cephadm_pip_deps: build-time RPM deps only +# - without cephadm_bundling: unbundled cephadm, runtime Requires for yaml/jinja2 +# CentOS Storage SIG #75389 needs the unbundled branch (--without cephadm_bundling) +# after dropping downstream patch 0036; pip-mode SIG builds are a separate SIG fix. %if 0%{with cephadm_bundling} %if 0%{without cephadm_pip_deps} -BuildRequires: python3-jinja2 >= 2.10 +# Zipapp built from system RPMs at build time; bundled zipapp is self-contained at runtime. +# SUSE and RHEL/Fedora use different PyPI RPM names (Jinja2/PyYAML vs jinja2/pyyaml). +%if 0%{?suse_version} +BuildRequires: python%{python3_pkgversion}-Jinja2 >= 2.10 +BuildRequires: python%{python3_pkgversion}-PyYAML +%else +BuildRequires: python%{python3_pkgversion}-jinja2 >= 2.10 +BuildRequires: python%{python3_pkgversion}-pyyaml +%endif +%dnl suse/else: rpm bundle, distinct RPM names only (not duplicate stanzas) %endif +%dnl end without cephadm_pip_deps (CEPHADM_BUNDLED_DEPENDENCIES=rpm) %else -Requires: python3-jinja2 >= 2.10 +# Unbundled cephadm: host must provide yaml and jinja2 at runtime. +%if 0%{?suse_version} +Requires: python%{python3_pkgversion}-Jinja2 >= 2.10 +Requires: python%{python3_pkgversion}-PyYAML +%else +Requires: python%{python3_pkgversion}-jinja2 >= 2.10 +Requires: python%{python3_pkgversion}-pyyaml +%endif +%dnl suse/else: unbundled cephadm (CEPHADM_BUNDLED_DEPENDENCIES=none) %endif +%dnl end with cephadm_bundling %description -n cephadm Utility to bootstrap a Ceph cluster and manage Ceph daemons deployed with systemd and podman.