Comment 3 for bug 1750656

Revision history for this message
Jean-Philippe Evrard (jean-philippe-evrard) wrote :

After a discussion this looks valid to me:
Because https://github.com/ansible/ansible/blob/v2.4.3.0-1/lib/ansible/modules/packaging/os/apt_repository.py#L542-L544 is in the same try: block of the file saving, any failure would get reported as a failure, but the file wouldn't be reverted to previous state before reporting failure on https://github.com/ansible/ansible/blob/v2.4.3.0-1/lib/ansible/modules/packaging/os/apt_repository.py#L547.

We have the state of before/after, so it should be used for a revert.