tests: fix LRU test after splitting up Connection class.

The module the connection class is now loaded as is
"ansible.plugins.connection.mitogen_ssh", etc., which breaks the test.
Instead, check if the connection is an instance of the base Connection
class.
This commit is contained in:
David Wilson 2018-05-04 17:38:49 +01:00
parent 42cc009b60
commit f98279fc95
1 changed files with 4 additions and 2 deletions

View File

@ -6,6 +6,7 @@ required for reliable LRU tests.
import traceback
import sys
import ansible_mitogen.connection
import ansible_mitogen.services
import mitogen.service
@ -15,9 +16,10 @@ from ansible.plugins.action import ActionBase
class ActionModule(ActionBase):
def run(self, tmp=None, task_vars=None):
if not type(self._connection).__module__.startswith('ansible_mitogen'):
if not isinstance(self._connection,
ansible_mitogen.connection.Connection):
return {
'changed': False
'skipped': True,
}
self._connection._connect()