From ceb90f6632a5013d6845424d459511eaa155fe2f Mon Sep 17 00:00:00 2001 From: linnil1 Date: Tue, 4 Sep 2018 14:29:08 +0800 Subject: [PATCH] Fix sshkeyfilename is None not str (#44893) (cherry picked from commit 177fbea35167eb4914c89ae77f0ead568823ac09) --- lib/ansible/plugins/connection/netconf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/plugins/connection/netconf.py b/lib/ansible/plugins/connection/netconf.py index 93468f14384..5477729f0d9 100644 --- a/lib/ansible/plugins/connection/netconf.py +++ b/lib/ansible/plugins/connection/netconf.py @@ -256,7 +256,7 @@ class Connection(NetworkConnectionBase): self.key_filename = self._play_context.private_key_file or self.get_option('private_key_file') if self.key_filename: - self.key_filename = os.path.expanduser(self.key_filename) + self.key_filename = str(os.path.expanduser(self.key_filename)) if self._network_os == 'default': for cls in netconf_loader.all(class_only=True): @@ -279,7 +279,7 @@ class Connection(NetworkConnectionBase): port=self._play_context.port or 830, username=self._play_context.remote_user, password=self._play_context.password, - key_filename=str(self.key_filename), + key_filename=self.key_filename, hostkey_verify=self.get_option('host_key_checking'), look_for_keys=self.get_option('look_for_keys'), device_params=device_params,