Skip to content

Commit

Permalink
Fix wrong backup directory var name in apt module (#73840)
Browse files Browse the repository at this point in the history
* Fix wrong backup directory var name in apt module
  • Loading branch information
xabinapal committed Mar 22, 2021
1 parent 2c40dcc commit 2bff120
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions changelogs/fragments/73840_apt-policy-rc-d.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bugfixes:
- >-
apt - fix policy_rc_d parameter throwing an exception when restoring
original file (https://github.com/ansible/ansible/issues/66211)
2 changes: 1 addition & 1 deletion lib/ansible/modules/apt.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def __exit__(self, type, value, traceback):
try:
shutil.move(os.path.join(self.backup_dir, 'policy-rc.d'),
'/usr/sbin/policy-rc.d')
os.rmdir(self.tmpdir_name)
os.rmdir(self.backup_dir)
except Exception:
self.m.fail_json(msg="Fail to move back %s to /usr/sbin/policy-rc.d"
% os.path.join(self.backup_dir, 'policy-rc.d'))
Expand Down

0 comments on commit 2bff120

Please sign in to comment.