Fix C.ANSIBLE_SSH_CONTROL_PATH string interpolation

Since C.ANSIBLE_SSH_CONTROL_PATH use the old format
( "%{directory}" ), we need to use the % operator
and not the format method, at least for python 2.
This commit is contained in:
Michael Scherer 2015-04-19 00:06:50 -04:00
parent 5d446bbd5b
commit cd25e0fba0

View file

@ -74,7 +74,7 @@ class Connection(ConnectionBase):
self._common_args += ( self._common_args += (
"-o", "ControlMaster=auto", "-o", "ControlMaster=auto",
"-o", "ControlPersist=60s", "-o", "ControlPersist=60s",
"-o", "ControlPath=\"{0}\"".format(C.ANSIBLE_SSH_CONTROL_PATH.format(dict(directory=self._cp_dir))), "-o", "ControlPath=\"{0}\"".format(C.ANSIBLE_SSH_CONTROL_PATH % dict(directory=self._cp_dir)),
) )
cp_in_use = False cp_in_use = False
@ -87,7 +87,7 @@ class Connection(ConnectionBase):
if cp_in_use and not cp_path_set: if cp_in_use and not cp_path_set:
self._common_args += ("-o", "ControlPath=\"{0}\"".format( self._common_args += ("-o", "ControlPath=\"{0}\"".format(
C.ANSIBLE_SSH_CONTROL_PATH.format(dict(directory=self._cp_dir))) C.ANSIBLE_SSH_CONTROL_PATH % dict(directory=self._cp_dir))
) )
if not C.HOST_KEY_CHECKING: if not C.HOST_KEY_CHECKING: