issue #587: 2.8 PlayContext lacks sudo_flags attribute.

This is a huge bodge.
pull/595/head
David Wilson 6 years ago
parent e11b251c75
commit c1c8d5c31e

@ -276,8 +276,8 @@ class StrategyMixin(object):
class_only=True, class_only=True,
) )
if play_context.connection is not Sentinel: if play_context.connection is not Sentinel:
# 2.8 appears to defer computing this value until it's inside the # 2.8 appears to defer computing this until inside the worker.
# worker. TODO: figure out where this value has moved. # TODO: figure out where it has moved.
ansible_mitogen.loaders.connection_loader.get( ansible_mitogen.loaders.connection_loader.get(
name=play_context.connection, name=play_context.connection,
class_only=True, class_only=True,

@ -380,8 +380,9 @@ class PlayContextSpec(Spec):
for term in ansible.utils.shlex.shlex_split( for term in ansible.utils.shlex.shlex_split(
first_true(( first_true((
self._play_context.become_flags, self._play_context.become_flags,
self._play_context.sudo_flags, # Ansible <=2.7.
# Ansible 2.3. getattr(self._play_context, 'sudo_flags', ''),
# Ansible <=2.3.
getattr(C, 'DEFAULT_BECOME_FLAGS', ''), getattr(C, 'DEFAULT_BECOME_FLAGS', ''),
getattr(C, 'DEFAULT_SUDO_FLAGS', '') getattr(C, 'DEFAULT_SUDO_FLAGS', '')
), default='') ), default='')

Loading…
Cancel
Save