diff --git a/ansible_mitogen/strategy.py b/ansible_mitogen/strategy.py index 1060e3b5..b6b9aaf2 100644 --- a/ansible_mitogen/strategy.py +++ b/ansible_mitogen/strategy.py @@ -276,8 +276,8 @@ class StrategyMixin(object): class_only=True, ) if play_context.connection is not Sentinel: - # 2.8 appears to defer computing this value until it's inside the - # worker. TODO: figure out where this value has moved. + # 2.8 appears to defer computing this until inside the worker. + # TODO: figure out where it has moved. ansible_mitogen.loaders.connection_loader.get( name=play_context.connection, class_only=True, diff --git a/ansible_mitogen/transport_config.py b/ansible_mitogen/transport_config.py index ad1cab3e..d5f15b10 100644 --- a/ansible_mitogen/transport_config.py +++ b/ansible_mitogen/transport_config.py @@ -380,8 +380,9 @@ class PlayContextSpec(Spec): for term in ansible.utils.shlex.shlex_split( first_true(( self._play_context.become_flags, - self._play_context.sudo_flags, - # Ansible 2.3. + # Ansible <=2.7. + getattr(self._play_context, 'sudo_flags', ''), + # Ansible <=2.3. getattr(C, 'DEFAULT_BECOME_FLAGS', ''), getattr(C, 'DEFAULT_SUDO_FLAGS', '') ), default='')