Skip to content

Commit

Permalink
Pass default None to getattr, remove repeated call
Browse files Browse the repository at this point in the history
  • Loading branch information
amenonsen committed Oct 2, 2015
1 parent 478e234 commit b127221
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/ansible/plugins/connection/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,9 @@ def _build_command(self, binary, *other_args):
# (i.e. inventory or task settings or overrides on the command line).

for opt in ['ssh_common_args', binary + '_extra_args']:
if getattr(self._play_context, opt):
args = self._split_args(getattr(self._play_context, opt))
attr = getattr(self._play_context, opt, None)
if attr is not None:
args = self._split_args(attr)
self._add_args("PlayContext set %s" % opt, args)

# Check if ControlPersist is enabled and add a ControlPath if one hasn't
Expand Down

0 comments on commit b127221

Please sign in to comment.