From dcd751a767f3f0da8e1e708a2b7fda36c706571f 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 aceeabd2b85..058b13800a5 100644 --- a/lib/ansible/plugins/connection/paramiko_ssh.py +++ b/lib/ansible/plugins/connection/paramiko_ssh.py @@ -122,10 +122,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.