From de306eb5da7054a001e0b630db50732bf178e8a8 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Wed, 16 Mar 2016 11:22:50 -0700 Subject: [PATCH] Small cleanup to use class attribute directly instead of property for transport names --- lib/ansible/plugins/connection/local.py | 5 +---- lib/ansible/plugins/connection/paramiko_ssh.py | 5 +---- lib/ansible/plugins/connection/winrm.py | 6 +----- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/lib/ansible/plugins/connection/local.py b/lib/ansible/plugins/connection/local.py index 79ba8ab8bc1..9a956ca7359 100644 --- a/lib/ansible/plugins/connection/local.py +++ b/lib/ansible/plugins/connection/local.py @@ -43,10 +43,7 @@ except ImportError: class Connection(ConnectionBase): ''' Local based connections ''' - @property - def transport(self): - ''' used to identify this connection object ''' - return 'local' + transport = 'local' def _connect(self): ''' connect to the local host; nothing to do here ''' diff --git a/lib/ansible/plugins/connection/paramiko_ssh.py b/lib/ansible/plugins/connection/paramiko_ssh.py index 557acc96900..150d168bf5f 100644 --- a/lib/ansible/plugins/connection/paramiko_ssh.py +++ b/lib/ansible/plugins/connection/paramiko_ssh.py @@ -126,10 +126,7 @@ SFTP_CONNECTION_CACHE = {} class Connection(ConnectionBase): ''' SSH based connections with Paramiko ''' - @property - def transport(self): - ''' used to identify this connection object from other classes ''' - return 'paramiko' + transport = 'paramiko' def _cache_key(self): return "%s__%s__" % (self._play_context.remote_addr, self._play_context.remote_user) diff --git a/lib/ansible/plugins/connection/winrm.py b/lib/ansible/plugins/connection/winrm.py index 125e54cb9aa..3c079a1f2e2 100644 --- a/lib/ansible/plugins/connection/winrm.py +++ b/lib/ansible/plugins/connection/winrm.py @@ -61,6 +61,7 @@ except ImportError: class Connection(ConnectionBase): '''WinRM connections over HTTP/HTTPS.''' + transport = 'winrm' module_implementation_preferences = ('.ps1', '') become_methods = [] allow_executable = False @@ -77,11 +78,6 @@ class Connection(ConnectionBase): super(Connection, self).__init__(*args, **kwargs) - @property - def transport(self): - ''' used to identify this connection object from other classes ''' - return 'winrm' - def set_host_overrides(self, host): ''' Override WinRM-specific options from host variables.