Fix wrong backup directory var name in apt module (#73840) (#74002)

(cherry picked from commit 2bff120db6)
pull/73965/head
Xabier Napal 4 years ago committed by GitHub
parent 502f7c22d9
commit f1f2d96456
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)

@ -405,7 +405,7 @@ class PolicyRcD(object):
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'))

Loading…
Cancel
Save