community.general icon indicating copy to clipboard operation
community.general copied to clipboard

flatpak module: incorrect task status reported for updating depending on language

Open kevonfernando opened this issue 1 year ago • 3 comments

Summary

Installing/Updating apps with the flatpak module always reports changed as task status when language is not english. See flatpak.py line 250

Issue Type

Bug Report

Component Name

flatpak

Ansible Version

$ ansible --version

Community.general Version

$ ansible-galaxy collection list community.general
ansible [core 2.16.10]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/var/home/kevonfernando/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.12/site-packages/ansible
  ansible collection location = /var/home/kevonfernando/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.12.6 (main, Sep  9 2024, 00:00:00) [GCC 14.2.1 20240801 (Red Hat 14.2.1-1)] (/usr/bin/python3)
  jinja version = 3.1.4
  libyaml = True

Configuration

$ ansible-config dump --only-changed

OS / Environment

Control node:

  • Fedora 40 toolbox container
  • Ansible installed from Fedora 40 repos Target node:
  • Fedora Silverblue 40

Steps to Reproduce

- name: Install flatpaks from the Flathub remote to the system installation
  community.general.flatpak:
    method: system
    remote: flathub
    name:
      - page.kramo.Cartridges
    state: latest

Expected Results

I expected the reported task status to be ok and not changed.

Actual Results


Code of Conduct

  • [X] I agree to follow the Ansible Code of Conduct

kevonfernando avatar Sep 19 '24 19:09 kevonfernando

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot avatar Sep 19 '24 20:09 ansibullbot

cc @JayKayy @oolongbrothers click here for bot help

ansibullbot avatar Sep 19 '24 20:09 ansibullbot

I guess something like module.run_command_environ_update = dict(LANG='C', LC_ALL='C', LC_MESSAGES='C', LC_CTYPE='C') (or using the environ_update parameter of module.run_command() with a similar dict) would help here.

felixfontein avatar Sep 20 '24 06:09 felixfontein