Fix issues with enable become plugin (#52657)

* Work around become_user not being set
This commit is contained in:
Nathaniel Case 2019-02-20 16:15:45 -05:00 committed by GitHub
parent 67f14772b1
commit 1b9745722e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -291,7 +291,8 @@ class ActionBase(with_metaclass(ABCMeta, object)):
# we need to return become_unprivileged as True
admin_users = self._get_admin_users()
remote_user = self._get_remote_user()
return bool(self.get_become_option('become_user') not in admin_users + [remote_user])
become_user = self.get_become_option('become_user')
return bool(become_user and become_user not in admin_users + [remote_user])
def _make_tmp_path(self, remote_user=None):
'''