Pass default None to getattr, remove repeated call
This commit is contained in:
parent
478e234bc3
commit
b127221f50
1 changed files with 3 additions and 2 deletions
|
@ -204,8 +204,9 @@ class Connection(ConnectionBase):
|
||||||
# (i.e. inventory or task settings or overrides on the command line).
|
# (i.e. inventory or task settings or overrides on the command line).
|
||||||
|
|
||||||
for opt in ['ssh_common_args', binary + '_extra_args']:
|
for opt in ['ssh_common_args', binary + '_extra_args']:
|
||||||
if getattr(self._play_context, opt):
|
attr = getattr(self._play_context, opt, None)
|
||||||
args = self._split_args(getattr(self._play_context, opt))
|
if attr is not None:
|
||||||
|
args = self._split_args(attr)
|
||||||
self._add_args("PlayContext set %s" % opt, args)
|
self._add_args("PlayContext set %s" % opt, args)
|
||||||
|
|
||||||
# Check if ControlPersist is enabled and add a ControlPath if one hasn't
|
# Check if ControlPersist is enabled and add a ControlPath if one hasn't
|
||||||
|
|
Loading…
Reference in a new issue