python 2

Spacewalk: "rhnpackageevr" violates check constraint "vn_rhnpackageevr_release"

Spacewalk logó
Probléma: Nem megy egyes kliensek rendszerhez történő regisztrálása. Az rhnreg_ks parancs csak internal server error hibaüzenettel tér vissza. A /var/log/httpd/error.log és/vagy /var/log/rhn/rhn_server_xmlrpc naplóállományok a következő hibaüzenetet tartalmazzák:

Ansible: The Python 2 bindings for rpm are needed for this module

Ansible logó
Probléma: fatal: [127.0.0.1]: FAILED! => {"changed": false, "msg": "The Python 2 bindings for rpm are needed for this module. If you require Python 3 support use the `dnf` Ansible module instead.. The Python 2 yum module is needed for this module. If you require Python 3 support use the `dnf` Ansible module instead."}

A 2.8-as Ansible alapértelmezetten a Python 3-as verziójával próbál futni (mivel ugye a 2.x támogatása hamarosan véget ér). Azonban a 3-as Python verzióhoz nem érhető el a yum modul, a javasolt dnf modul pedig nem használható CentOS 7-en mivel ott még yum van.

Python virtualenv: Python 2 kikényszerítése

Probléma: A rendszereden a Python 3 az alapértelmezett, ám neked Python 2-es virtualenv környezetre van szükséged.
Megoldás: A virtualenv parancshoz használd a -p python2 kapcsolót: virtualenv -p python2 venv