Skip to content

Commit

Permalink
tests: enable locale_gen not only for Debian
Browse files Browse the repository at this point in the history
Signed-off-by: Konstantin Shalygin <k0ste@k0ste.ru>
  • Loading branch information
k0ste committed Feb 17, 2025
1 parent 3cdddbc commit 966285f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
bugfixes:
- "locale_gen - use ``glibc_ubuntu`` mode only if files for that exists (https://github.com/ansible-collections/community.general/pull/9735)."
- "locale_gen - use ``glibc`` mode only if files for that exists. In other case us ``other_glibc`` mode (https://github.com/ansible-collections/community.general/pull/9735)."
12 changes: 6 additions & 6 deletions plugins/modules/locale_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
description: Mechanism used to deploy the locales.
type: str
choices:
- ubuntu_glibc
- ubuntu_legacy
- glibc
- ubuntu_legacy
- other_glibc
returned: success
sample: glibc
version_added: 10.2.0
Expand Down Expand Up @@ -120,22 +120,22 @@ def __init_module__(self):
available=SUPPORTED_LOCALES,
apply_change=self.apply_change_ubuntu_legacy,
),
ubuntu_glibc=dict(
glibc=dict(
available=SUPPORTED_LOCALES,
apply_change=self.apply_change_glibc,
),
glibc=dict(
other_glibc=dict(
available=ETC_LOCALE_GEN,
apply_change=self.apply_change_glibc,
),
)

if os.path.exists(ETC_LOCALE_GEN) and os.path.exists(SUPPORTED_LOCALES):
self.vars.ubuntu_mode = False
self.vars.mechanism = "ubuntu_glibc"
self.vars.mechanism = "glibc"
elif os.path.exists(ETC_LOCALE_GEN):
self.vars.ubuntu_mode = False
self.vars.mechanism = "glibc"
self.vars.mechanism = "other_glibc"
elif os.path.exists(VAR_LIB_LOCALES):
self.vars.ubuntu_mode = True
self.vars.mechanism = "ubuntu_legacy"
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/targets/locale_gen/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

- name: Bail out if not supported
ansible.builtin.meta: end_play
when: ansible_distribution not in ('Ubuntu', 'Debian')
when:
- "ansible_distribution != 'MacOSX'"

- name: Run tests auto-detecting mechanism
ansible.builtin.include_tasks: basic.yml
Expand Down

0 comments on commit 966285f

Please sign in to comment.