Bug#983140: closed by Debian FTP Masters (reply to Lee Garrett ) (Bug#983140: fixed in ansible 2.10.7+merged+base+2.10.8+dfsg-1)

2021-04-22 Thread Lee Garrett
Hi Baptiste,

On 20/04/2021 22:07, Baptiste Beauplat wrote:
> Hi Lee,
> 
> On 2021/04/19 11:06 PM, Debian Bug Tracking System wrote:
>> #983140: ansible: Does not detect correct python interpreter on bullseye 
>> target
>>
>> It has been closed by Debian FTP Masters  
>> (reply to Lee Garrett ).
> 
> Glad to hear this will be fixed by this new version.
> 
> I was also working on a patch for 2.9.16 but I guess it's a bit late of
> that :)
> 
> I'll attach it anyway for reference because I managed to have all unit
> tests working by avoiding the user home directory. You might be
> interested to have a look at that.

Thanks for the attachment, I'll have a look at it to see how you solved
the problems I ran into.

> 
> Thanks again for maintaining ansible!
> 
> Best,
> 

You're welcome! And thanks for helping out. :)

Greets,
Lee



Bug#983140: closed by Debian FTP Masters (reply to Lee Garrett ) (Bug#983140: fixed in ansible 2.10.7+merged+base+2.10.8+dfsg-1)

2021-04-20 Thread Baptiste Beauplat
Hi Lee,

On 2021/04/19 11:06 PM, Debian Bug Tracking System wrote:
> #983140: ansible: Does not detect correct python interpreter on bullseye 
> target
> 
> It has been closed by Debian FTP Masters  
> (reply to Lee Garrett ).

Glad to hear this will be fixed by this new version.

I was also working on a patch for 2.9.16 but I guess it's a bit late of
that :)

I'll attach it anyway for reference because I managed to have all unit
tests working by avoiding the user home directory. You might be
interested to have a look at that.

Thanks again for maintaining ansible!

Best,

-- 
Baptiste Beauplat - lyknode
diff -Nru ansible-2.9.16+dfsg/debian/changelog 
ansible-2.9.16+dfsg/debian/changelog
--- ansible-2.9.16+dfsg/debian/changelog2021-01-06 11:56:22.0 
+0100
+++ ansible-2.9.16+dfsg/debian/changelog2021-04-17 15:27:02.0 
+0200
@@ -1,3 +1,11 @@
+ansible (2.9.16+dfsg-1.2) bullseye; urgency=medium
+
+  * Non-maintainer upload.
+  * Use python3.9 as default interpreter (Closes: #983140)
+  * Add autopkgtest to run a working subset of ansible test suite
+
+ -- Baptiste Beauplat   Sat, 17 Apr 2021 15:27:02 +0200
+
 ansible (2.9.16+dfsg-1.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru 
ansible-2.9.16+dfsg/debian/patches/0007-fix-interpreter-fallback.patch 
ansible-2.9.16+dfsg/debian/patches/0007-fix-interpreter-fallback.patch
--- ansible-2.9.16+dfsg/debian/patches/0007-fix-interpreter-fallback.patch  
1970-01-01 01:00:00.0 +0100
+++ ansible-2.9.16+dfsg/debian/patches/0007-fix-interpreter-fallback.patch  
2021-04-17 15:27:02.0 +0200
@@ -0,0 +1,33 @@
+Description: Fix python interpreter discovery (Closes: #983140)
+ On machines upgrade from buster to bullseye, the wrong interpreter will be
+ discovered and used, causing the playbook run to fail. Update the fallback 
list
+ so it correctly picks python3.9 on bullseye when both 3.9 and 3.7 are present,
+ which usually is the case on freshly upgrade machines.
+Origin: backport, 
https://github.com/ansible/ansible/commit/c986cbb9961bfaedf1a6ae7f0c2e34be26d9ab12
+Forwarded: not-needed
+Applied-Upstream: 
https://github.com/ansible/ansible/commit/c986cbb9961bfaedf1a6ae7f0c2e34be26d9ab12
+Reviewed-by: Lee Garrett 
+Last-Update: 2021-03-23
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/lib/ansible/config/base.yml
 b/lib/ansible/config/base.yml
+@@ -1523,6 +1523,8 @@
+   name: Ordered list of Python interpreters to check for in discovery
+   default:
+   - /usr/bin/python
++  - python3.9
++  - python3.8
+   - python3.7
+   - python3.6
+   - python3.5
+--- a/test/lib/ansible_test/_internal/util.py
 b/test/lib/ansible_test/_internal/util.py
+@@ -110,6 +110,7 @@
+ '3.6',
+ '3.7',
+ '3.8',
++'3.9',
+ )
+
+
diff -Nru ansible-2.9.16+dfsg/debian/patches/0008-fix-tests.patch 
ansible-2.9.16+dfsg/debian/patches/0008-fix-tests.patch
--- ansible-2.9.16+dfsg/debian/patches/0008-fix-tests.patch 1970-01-01 
01:00:00.0 +0100
+++ ansible-2.9.16+dfsg/debian/patches/0008-fix-tests.patch 2021-04-17 
15:27:02.0 +0200
@@ -0,0 +1,44 @@
+From: Baptiste Beauplat 
+Date: Mon, 19 Apr 2021 20:41:09 +0200
+Subject: Fix test suite
+
+* Mark two tests depending on pycrypto with the correct skipif
+* Inject remote_tmp configuration to point to /tmp to handle testbed without
+  HOME
+* Truncate output check on test_build_requirement_from_path_no_version due to 
an
+  issue with text wrapping
+--- a/test/units/parsing/vault/test_vault.py
 b/test/units/parsing/vault/test_vault.py
+@@ -528,6 +528,7 @@
+ b_key_pycrypto = self.vault_cipher._create_key_pycrypto(b_password, 
b_salt, key_length=32, iv_length=16)
+ self.assertEqual(b_key_cryptography, b_key_pycrypto)
+ 
++@pytest.mark.skipif(not vault.HAS_PYCRYPTO, reason='Not testing 
cryptography known key as pycrypto is not installed')
+ def test_create_key_known_cryptography(self):
+ b_password = b'hunter42'
+ 
+@@ -555,6 +556,7 @@
+ self.assertEqual(b_key_3, b_key_4)
+ self.assertEqual(b_key_1, b_key_4)
+ 
++@pytest.mark.skipif(not vault.HAS_PYCRYPTO, reason='Not testing pycrypto 
known key as pycrypto is not installed')
+ def test_create_key_known_pycrypto(self):
+ b_password = b'hunter42'
+ 
+--- /dev/null
 b/test/lib/ansible_test/_data/ansible.cfg
+@@ -0,0 +1,2 @@
++[defaults]
++remote_tmp = /tmp/ansible
+--- a/test/units/galaxy/test_collection_install.py
 b/test/units/galaxy/test_collection_install.py
+@@ -242,8 +242,7 @@
+ assert mock_display.call_count == 1
+ 
+ actual_warn = ' '.join(mock_display.mock_calls[0][1][0].split('\n'))
+-expected_warn = "Collection at '%s' does not have a valid version set, 
falling back to '*'. Found version: ''" \
+-% to_text(collection_artifact[0])
++expected_warn = "does not have a valid version set, falling back to '*'. 
Found version: ''"
+ assert expected_warn in