Repository: ansible/ansible

Issue:
Random output of "sudo -H -S -n"
<!---
Verify first that your issue/request is not already reported on GitHub.
Also test if the latest release, and master branch are affected too.
-->

##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Bug Report


##### COMPONENT NAME
<!--- Name of the module/plugin/task/feature -->
Core?

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes below -->
```
$ ansible --version
ansible 2.5.0 (devel e4c9ffa7e6) last updated 2017/09/25 08:22:05 (GMT -500)
  config file = None
  configured module search path = [u'/Users/tanner/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/tanner/projects/ansible.git/ansible/lib/ansible
  executable location = /Users/tanner/projects/ansible.git/ansible/bin/ansible
  python version = 2.7.10 (default, Feb  7 2017, 00:08:15) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]
```

##### CONFIGURATION
<!---
If using Ansible 2.4 or above, paste the results of "ansible-config dump --only-changed"

Otherwise, mention any settings you have changed/added/removed in ansible.cfg
(or using the ANSIBLE_* environment variables).

-->

##### OS / ENVIRONMENT
<!---
Mention the OS you are running Ansible from, and the OS you are
managing, or say "N/A" for anything that is not platform-specific.
Also mention the specific version of what you are trying to control,
e.g. if this is a network bug the version of firmware on the network device.
-->
Management host: macOS
Managed host: Windows 7

##### SUMMARY
<!--- Explain the problem briefly -->
Looks like debug code made it into devel and the become logic displays, 
```
sudo
-H -S -n
```
##### STEPS TO REPRODUCE
<!---
For bugs, show exactly how to reproduce the problem, using a minimal test-case.
For new features, show how the feature would be used.
-->

<!--- Paste example playbooks or commands between quotes below -->
```yaml
Any task that becomes: yes
```

<!--- You can also paste gist.github.com links for larger files -->

##### EXPECTED RESULTS
<!--- What did you expect to happen when running the steps above? -->
Not to display sudo -H -S -n

##### ACTUAL RESULTS
<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->

<!--- Paste verbatim command output between quotes below -->
```
TASK [updates ] *************
skipping: [www.XXXXX.org]
sudo
-H -S -n
sudo
-H -S -n
sudo
-H -S -n
sudo
-H -S -n
```


Discussion:

Resolving patch:
diff --git a/lib/ansible/playbook/play_context.py b/lib/ansible/playbook/play_context.py
--- a/lib/ansible/playbook/play_context.py
+++ b/lib/ansible/playbook/play_context.py
@@ -533,8 +533,6 @@ def make_become_cmd(self, cmd, executable=None):
             # set flags to use for the privilege escalation method, with various overrides
             flags = self.become_flags or getattr(self, '%s_flags' % self.become_method, '')
 
-            print(exe)
-            print(flags)
             if self.become_method == 'sudo':
                 # If we have a password, we run sudo with a randomly-generated
                 # prompt set using -p. Otherwise we run it with default -n, which makes


Test patch: