summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhijit Menon-Sen <ams@2ndQuadrant.com>2015-10-02 20:04:01 +0530
committerAbhijit Menon-Sen <ams@2ndQuadrant.com>2015-10-02 21:26:25 +0530
commitb127221f503b43af4af5cf5e7eb8b9ec80ecf173 (patch)
treef74c062b7c397bd5829b80188fd54eff9a561584
parent478e234bc3fab8668a575aafc811797bd834b424 (diff)
downloadansible-b127221f503b43af4af5cf5e7eb8b9ec80ecf173.tar.gz
Pass default None to getattr, remove repeated call
-rw-r--r--lib/ansible/plugins/connection/ssh.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ansible/plugins/connection/ssh.py b/lib/ansible/plugins/connection/ssh.py
index 10e96ae039..29648b591a 100644
--- a/lib/ansible/plugins/connection/ssh.py
+++ b/lib/ansible/plugins/connection/ssh.py
@@ -204,8 +204,9 @@ class Connection(ConnectionBase):
# (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