-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…#6817) locale_gen: works with C.UTF-8 (#6774) * locale_gen: fix * test working with C.UTF-8 * working with locale eo * handle C.UTF-8 edge cases * grammatic pedantism * add changelog frag * add doc about specific OS support * update changelog frag (cherry picked from commit 3fd4cdb) Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
- Loading branch information
1 parent
8cf2358
commit 540c92f
Showing
7 changed files
with
137 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bugfixes: | ||
- locale_gen - now works for locales without the underscore character such as ``C.UTF-8`` (https://github.com/ansible-collections/community.general/pull/6774, https://github.com/ansible-collections/community.general/issues/5142, https://github.com/ansible-collections/community.general/issues/4305). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,5 @@ azp/posix/3 | |
destructive | ||
needs/root | ||
skip/aix | ||
skip/freebsd | ||
skip/macos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
--- | ||
# Copyright (c) Ansible Project | ||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
- name: Is the locale we're going to test against installed? {{ locale_basic.localegen }} | ||
command: locale -a | ||
register: initial_state | ||
ignore_errors: true | ||
|
||
- name: Make sure the locale is not installed {{ locale_basic.localegen }} | ||
locale_gen: | ||
name: "{{ locale_basic.localegen }}" | ||
state: absent | ||
|
||
- name: Is the locale present? {{ locale_basic.localegen }} | ||
command: locale -a | ||
register: cleaned | ||
ignore_errors: true | ||
|
||
- name: Make sure the locale is not present {{ locale_basic.localegen }} | ||
assert: | ||
that: | ||
- locale_basic.skip_removal or locale_basic.locales | intersect(cleaned.stdout_lines) == [] | ||
|
||
- name: Install the locale {{ locale_basic.localegen }} | ||
locale_gen: | ||
name: "{{ locale_basic.localegen }}" | ||
state: present | ||
register: output_present | ||
|
||
- name: Is the locale present? {{ locale_basic.localegen }} | ||
command: locale -a | ||
register: post_check_output_present | ||
ignore_errors: true | ||
|
||
- name: Make sure the locale is present and we say we installed it {{ locale_basic.localegen }} | ||
assert: | ||
that: | ||
- locale_basic.locales | intersect(post_check_output_present.stdout_lines) != [] | ||
- locale_basic.skip_removal or output_present is changed | ||
|
||
- name: Install the locale a second time {{ locale_basic.localegen }} | ||
locale_gen: | ||
name: "{{ locale_basic.localegen }}" | ||
state: present | ||
register: output_present_idempotent | ||
|
||
- name: Is the locale present? {{ locale_basic.localegen }} | ||
command: locale -a | ||
register: post_check_output_present_idempotent | ||
ignore_errors: true | ||
|
||
- name: Make sure the locale is present and we reported no change {{ locale_basic.localegen }} | ||
assert: | ||
that: | ||
- locale_basic.locales | intersect(post_check_output_present_idempotent.stdout_lines) != [] | ||
- output_present_idempotent is not changed | ||
|
||
- name: Removals | ||
when: locale_basic.skip_removal is false | ||
block: | ||
- name: Remove the locale {{ locale_basic.localegen }} | ||
locale_gen: | ||
name: "{{ locale_basic.localegen }}" | ||
state: absent | ||
register: output_absent | ||
|
||
- name: Is the locale present? {{ locale_basic.localegen }} | ||
command: locale -a | ||
register: post_check_output_absent | ||
ignore_errors: true | ||
|
||
- name: Make sure the locale is absent and we reported a change {{ locale_basic.localegen }} | ||
assert: | ||
that: | ||
- locale_basic.locales | intersect(post_check_output_absent.stdout_lines) == [] | ||
- output_absent is changed | ||
|
||
- name: Remove the locale a second time {{ locale_basic.localegen }} | ||
locale_gen: | ||
name: "{{ locale_basic.localegen }}" | ||
state: absent | ||
register: output_absent_idempotent | ||
|
||
- name: Is the locale present? {{ locale_basic.localegen }} | ||
command: locale -a | ||
register: post_check_output_absent_idempotent | ||
ignore_errors: true | ||
|
||
- name: Make sure the locale is absent and we reported no change {{ locale_basic.localegen }} | ||
assert: | ||
that: | ||
- locale_basic.locales | intersect(post_check_output_absent_idempotent.stdout_lines) == [] | ||
- output_absent_idempotent is not changed | ||
|
||
# Cleanup | ||
- name: Reinstall the locale we tested against if it was initially installed {{ locale_basic.localegen }} | ||
locale_gen: | ||
name: "{{ locale_basic.localegen }}" | ||
state: present | ||
when: locale_basic.locales | intersect(initial_state.stdout_lines) != [] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
# Copyright (c) Ansible Project | ||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
# locale_basic: pt_BR | ||
|
||
locale_list_basic: | ||
- localegen: pt_BR | ||
locales: [pt_BR] | ||
skip_removal: false | ||
- localegen: C.UTF-8 | ||
locales: [C.utf8, C.UTF-8] | ||
skip_removal: true | ||
- localegen: eo | ||
locales: [eo] | ||
skip_removal: false |