Bug#950898: ansible/buster: flatpak_remote: IndexError: list index out of range

2022-09-09 Thread Lee Garrett
AFAICS this error doesn't happen in bullseye anymore, as this patch was
merged there. So I'm closing this issue.

On 07/02/2020 23:13, Hector Oron Martinez wrote:
> Package: ansible
> Version: 2.7.7+dfsg-1
> Severity: important
> Tags: patch
> 
> Hello,
> 
> Note this issue only happens in stable, Buster 10.2 with ansible 2.7.7
> 
> When using ansible with flatpak_remote, it breaks. The following snippet:
> ```
> - name: Add the flathub flatpak repository remote to the user 
> installation
>   flatpak_remote:
> name: flathub
> state: present
> flatpakrepo_url: https://dl.flathub.org/repo/flathub.flatpakrepo
> method: user
> ```
> 
> causes:
> 
> ```
> TASK [Add the flathub flatpak repository remote to the user installation] 
> *
> fatal: [127.0.0.1]: FAILED! => {"changed": false, "module_stderr": 
> "/home/zumbi/.ansible/tmp/ansible-tmp-1581109559.271161-112064566806002/AnsiballZ_flatpak_remote.py:17:
>  DeprecationWarning: the imp module is deprecated in favour of importlib; see 
> the module's documentation for alternative uses\n  import imp\nTraceback 
> (most recent call last):\n  File 
> \"/home/zumbi/.ansible/tmp/ansible-tmp-1581109559.271161-112064566806002/AnsiballZ_flatpak_remote.py\",
>  line 113, in \n_ansiballz_main()\n  File 
> \"/home/zumbi/.ansible/tmp/ansible-tmp-1581109559.271161-112064566806002/AnsiballZ_flatpak_remote.py\",
>  line 105, in _ansiballz_main\ninvoke_module(zipped_mod, temp_path, 
> ANSIBALLZ_PARAMS)\n  File 
> \"/home/zumbi/.ansible/tmp/ansible-tmp-1581109559.271161-112064566806002/AnsiballZ_flatpak_remote.py\",
>  line 48, in invoke_module\nimp.load_module('__main__', mod, module, 
> MOD_DESC)\n  File \"/usr/lib/python3.7/imp.py\", line 234, in load_module\n   
>  return load_source(name, filename, file)\n  File 
> \"/usr/lib/python3.7/imp.py\", line 169, in load_source\nmodule = 
> _exec(spec, sys.modules[name])\n  File \"\", 
> line 630, in _exec\n  File \"\", line 
> 728, in exec_module\n  File \"\", line 219, in 
> _call_with_frames_removed\n  File 
> \"/tmp/ansible_flatpak_remote_payload_3i68y3ku/__main__.py\", line 241, in 
> \n  File 
> \"/tmp/ansible_flatpak_remote_payload_3i68y3ku/__main__.py\", line 230, in 
> main\n  File \"/tmp/ansible_flatpak_remote_payload_3i68y3ku/__main__.py\", 
> line 172, in remote_exists\nIndexError: list index out of range\n", 
> "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact 
> error", "rc": 1}
>   to retry, use: --limit 
> @/home/zumbi/SCM/GITAuth/local/ansible/playbook.retry
> ```
> 
> The issue has been reported upstream at:
> https://github.com/ansible/ansible/issues/51481
> 
> And a pull request has been merged:
> https://github.com/ansible/ansible/pull/54103
> 
> I am attaching a debdiff I have tested and fixes the issue above.
> Please, consider fixing this issue in Buster, via stable-updates. If you
> need help, please let me know, I am willing to proceed with the upload
> if you wish.
> 
> Regards
> 
> -- System Information:
> Debian Release: 10.2
>   APT prefers stable-updates
>   APT policy: (500, 'stable-updates'), (500, 'stable')
> Architecture: amd64 (x86_64)
> 
> Kernel: Linux 4.19.0-6-amd64 (SMP w/8 CPU cores)
> Kernel taint flags: TAINT_USER
> Locale: LANG=ca_ES.UTF-8, LC_CTYPE=ca_ES.UTF-8 (charmap=UTF-8), 
> LANGUAGE=ca_ES:ca (charmap=UTF-8)
> Shell: /bin/sh linked to /usr/bin/dash
> Init: systemd (via /run/systemd/system)
> LSM: AppArmor: enabled
> 
> Versions of packages ansible depends on:
> ii  python33.7.3-1
> ii  python3-crypto 2.6.1-9+b1
> ii  python3-cryptography   2.6.1-3+deb10u2
> ii  python3-httplib2   0.11.3-2
> ii  python3-jinja2 2.10-2
> ii  python3-netaddr0.7.19-1
> ii  python3-paramiko   2.4.2-0.1
> ii  python3-pkg-resources  40.8.0-1
> ii  python3-yaml   3.13-2
> 
> Versions of packages ansible recommends:
> ii  python3-jmespath   0.9.4-1
> ii  python3-kerberos   1.1.14-2
> ii  python3-libcloud   2.4.0-1
> ii  python3-selinux2.8-1+b1
> ii  python3-winrm  0.3.0-2
> ii  python3-xmltodict  0.11.0-2
> 
> Versions of packages ansible suggests:
> pn  cowsay   
> pn  sshpass  
> 
> -- no debconf information



Bug#950898: ansible/buster: flatpak_remote: IndexError: list index out of range

2020-02-07 Thread Hector Oron Martinez
Package: ansible
Version: 2.7.7+dfsg-1
Severity: important
Tags: patch

Hello,

Note this issue only happens in stable, Buster 10.2 with ansible 2.7.7

When using ansible with flatpak_remote, it breaks. The following snippet:
```
- name: Add the flathub flatpak repository remote to the user 
installation
  flatpak_remote:
name: flathub
state: present
flatpakrepo_url: https://dl.flathub.org/repo/flathub.flatpakrepo
method: user
```

causes:

```
TASK [Add the flathub flatpak repository remote to the user installation] 
*
fatal: [127.0.0.1]: FAILED! => {"changed": false, "module_stderr": 
"/home/zumbi/.ansible/tmp/ansible-tmp-1581109559.271161-112064566806002/AnsiballZ_flatpak_remote.py:17:
 DeprecationWarning: the imp module is deprecated in favour of importlib; see 
the module's documentation for alternative uses\n  import imp\nTraceback (most 
recent call last):\n  File 
\"/home/zumbi/.ansible/tmp/ansible-tmp-1581109559.271161-112064566806002/AnsiballZ_flatpak_remote.py\",
 line 113, in \n_ansiballz_main()\n  File 
\"/home/zumbi/.ansible/tmp/ansible-tmp-1581109559.271161-112064566806002/AnsiballZ_flatpak_remote.py\",
 line 105, in _ansiballz_main\ninvoke_module(zipped_mod, temp_path, 
ANSIBALLZ_PARAMS)\n  File 
\"/home/zumbi/.ansible/tmp/ansible-tmp-1581109559.271161-112064566806002/AnsiballZ_flatpak_remote.py\",
 line 48, in invoke_module\nimp.load_module('__main__', mod, module, 
MOD_DESC)\n  File \"/usr/lib/python3.7/imp.py\", line 234, in load_module\n
return load_source(name, filename, file)\n  File \"/usr/lib/python3.7/imp.py\", 
line 169, in load_source\nmodule = _exec(spec, sys.modules[name])\n  File 
\"\", line 630, in _exec\n  File \"\", line 728, in exec_module\n  File \"\", line 219, in _call_with_frames_removed\n  File 
\"/tmp/ansible_flatpak_remote_payload_3i68y3ku/__main__.py\", line 241, in 
\n  File \"/tmp/ansible_flatpak_remote_payload_3i68y3ku/__main__.py\", 
line 230, in main\n  File 
\"/tmp/ansible_flatpak_remote_payload_3i68y3ku/__main__.py\", line 172, in 
remote_exists\nIndexError: list index out of range\n", "module_stdout": "", 
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
to retry, use: --limit 
@/home/zumbi/SCM/GITAuth/local/ansible/playbook.retry
```

The issue has been reported upstream at:
https://github.com/ansible/ansible/issues/51481

And a pull request has been merged:
https://github.com/ansible/ansible/pull/54103

I am attaching a debdiff I have tested and fixes the issue above.
Please, consider fixing this issue in Buster, via stable-updates. If you
need help, please let me know, I am willing to proceed with the upload
if you wish.

Regards

-- System Information:
Debian Release: 10.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-6-amd64 (SMP w/8 CPU cores)
Kernel taint flags: TAINT_USER
Locale: LANG=ca_ES.UTF-8, LC_CTYPE=ca_ES.UTF-8 (charmap=UTF-8), 
LANGUAGE=ca_ES:ca (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages ansible depends on:
ii  python33.7.3-1
ii  python3-crypto 2.6.1-9+b1
ii  python3-cryptography   2.6.1-3+deb10u2
ii  python3-httplib2   0.11.3-2
ii  python3-jinja2 2.10-2
ii  python3-netaddr0.7.19-1
ii  python3-paramiko   2.4.2-0.1
ii  python3-pkg-resources  40.8.0-1
ii  python3-yaml   3.13-2

Versions of packages ansible recommends:
ii  python3-jmespath   0.9.4-1
ii  python3-kerberos   1.1.14-2
ii  python3-libcloud   2.4.0-1
ii  python3-selinux2.8-1+b1
ii  python3-winrm  0.3.0-2
ii  python3-xmltodict  0.11.0-2

Versions of packages ansible suggests:
pn  cowsay   
pn  sshpass  

-- no debconf information
diff -Nru ansible-2.7.7+dfsg/debian/changelog 
ansible-2.7.7+dfsg/debian/changelog
--- ansible-2.7.7+dfsg/debian/changelog 2019-02-21 08:44:57.0 +0100
+++ ansible-2.7.7+dfsg/debian/changelog 2020-02-07 22:07:29.0 +0100
@@ -1,3 +1,12 @@
+ansible (2.7.7+dfsg-1local1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Local test of upstream patch to fix flatpak module:
+https://github.com/ansible/ansible/issues/51481
+https://github.com/ansible/ansible/pull/54103
+
+ -- Hector   Fri, 07 Feb 2020 22:07:29 +0100
+
 ansible (2.7.7+dfsg-1) unstable; urgency=high
 
   * New upstream release
diff -Nru 
ansible-2.7.7+dfsg/debian/patches/d78b3424dd9e72132df9b52ee4e5422cd3094bd6.patch
 
ansible-2.7.7+dfsg/debian/patches/d78b3424dd9e72132df9b52ee4e5422cd3094bd6.patch
--- 
ansible-2.7.7+dfsg/debian/patches/d78b3424dd9e72132df9b52ee4e5422cd3094bd6.patch
1970-01-01 01:00:00.0 +0100
+++ 
ansible-2.7.7+dfsg/debian/patches/d78b3424dd9e72132df9b52ee4e5422cd3094bd6.patch
2020-02-07 22:07:29.0 +0100
@@ -0,0