mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-02 11:22:47 +00:00
hostname.py: Fix openSUSE distribution name (#47020)
All openSUSE distributions changed to the way they are returned from distro.id(). This patches fix the openSUSE Leap and SLES distro names, and adds one entry for Tumbleweed. These descriptions are capitilized, as expected by Ansible's hostname module. Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
This commit is contained in:
committed by
Sam Doran
parent
04bfec9dfe
commit
fa83a711b6
3
changelogs/fragments/suse_distro_names.yaml
Normal file
3
changelogs/fragments/suse_distro_names.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
bugfixes:
|
||||
- Add code to detect correctly a host running openSUSE Tumbleweed
|
||||
- Fix detection string for SUSE distribution variants like Leap and SLES (SUSE Enterprise Linux Server).
|
||||
@@ -565,7 +565,7 @@ class FedoraHostname(Hostname):
|
||||
|
||||
class SLESHostname(Hostname):
|
||||
platform = 'Linux'
|
||||
distribution = 'Suse linux enterprise server '
|
||||
distribution = 'Sles'
|
||||
try:
|
||||
distribution_version = get_distribution_version()
|
||||
# cast to float may raise ValueError on non SLES, we use float for a little more safety over int
|
||||
@@ -579,7 +579,13 @@ class SLESHostname(Hostname):
|
||||
|
||||
class OpenSUSEHostname(Hostname):
|
||||
platform = 'Linux'
|
||||
distribution = 'Opensuse '
|
||||
distribution = 'Opensuse leap'
|
||||
strategy_class = SystemdStrategy
|
||||
|
||||
|
||||
class TumbleweedHostname(Hostname):
|
||||
platform = 'Linux'
|
||||
distribution = 'Opensuse tumbleweed'
|
||||
strategy_class = SystemdStrategy
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user