mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 11:10:21 -07:00
Merge pull request #10717 from mscherer/fix_connexion_info
Fix various pylint issues ( missing import and wrong variable names )
This commit is contained in:
commit
61379a609b
1 changed files with 3 additions and 3 deletions
|
@ -25,7 +25,7 @@ import random
|
||||||
from ansible import constants as C
|
from ansible import constants as C
|
||||||
from ansible.template import Templar
|
from ansible.template import Templar
|
||||||
from ansible.utils.boolean import boolean
|
from ansible.utils.boolean import boolean
|
||||||
|
from ansible.errors import AnsibleError
|
||||||
|
|
||||||
__all__ = ['ConnectionInformation']
|
__all__ = ['ConnectionInformation']
|
||||||
|
|
||||||
|
@ -230,7 +230,7 @@ class ConnectionInformation:
|
||||||
elif self.become_method == 'pbrun':
|
elif self.become_method == 'pbrun':
|
||||||
exe = become_settings.get('pbrun_exe', 'pbrun')
|
exe = become_settings.get('pbrun_exe', 'pbrun')
|
||||||
flags = become_settings.get('pbrun_flags', '')
|
flags = become_settings.get('pbrun_flags', '')
|
||||||
becomecmd = '%s -b -l %s -u %s "%s"' % (exe, flags, user, success_cmd)
|
becomecmd = '%s -b -l %s -u %s "%s"' % (exe, flags, self.become_user, success_cmd)
|
||||||
|
|
||||||
elif self.become_method == 'pfexec':
|
elif self.become_method == 'pfexec':
|
||||||
exe = become_settings.get('pfexec_exe', 'pbrun')
|
exe = become_settings.get('pfexec_exe', 'pbrun')
|
||||||
|
@ -239,7 +239,7 @@ class ConnectionInformation:
|
||||||
becomecmd = '%s %s "%s"' % (exe, flags, success_cmd)
|
becomecmd = '%s %s "%s"' % (exe, flags, success_cmd)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise errors.AnsibleError("Privilege escalation method not found: %s" % method)
|
raise AnsibleError("Privilege escalation method not found: %s" % self.become_method)
|
||||||
|
|
||||||
return (('%s -c ' % executable) + pipes.quote(becomecmd), prompt, success_key)
|
return (('%s -c ' % executable) + pipes.quote(becomecmd), prompt, success_key)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue