From 8679d2e3968a5010917d1f88b1dd1a5ce4e08119 Mon Sep 17 00:00:00 2001 From: Nathaniel Case Date: Tue, 5 Dec 2017 12:46:00 -0500 Subject: [PATCH] Port integration tests to network_cli (#33583) * network_cli needs network_os * Work around for Python 3.x < 3.6 --- lib/ansible/executor/task_executor.py | 4 ++-- test/runner/lib/manage_ci.py | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py index e883a64ddf..e918b415a3 100644 --- a/lib/ansible/executor/task_executor.py +++ b/lib/ansible/executor/task_executor.py @@ -818,9 +818,9 @@ class TaskExecutor: stdin.close() if p.returncode == 0: - result = json.loads(stdout) + result = json.loads(to_text(stdout)) else: - result = json.loads(stderr) + result = json.loads(to_text(stderr)) if 'messages' in result: for msg in result.get('messages'): diff --git a/test/runner/lib/manage_ci.py b/test/runner/lib/manage_ci.py index 7ff7083e59..0138f5654c 100644 --- a/test/runner/lib/manage_ci.py +++ b/test/runner/lib/manage_ci.py @@ -72,11 +72,17 @@ class ManageNetworkCI(object): def wait(self): """Wait for instance to respond to ansible ping.""" + if self.core_ci.platform in ('vyos',): + connection_type = 'network_cli' + else: + connection_type = 'local' + extra_vars = [ 'ansible_host=%s' % self.core_ci.connection.hostname, 'ansible_port=%s' % self.core_ci.connection.port, - 'ansible_connection=local', + 'ansible_connection=%s' % connection_type, 'ansible_ssh_private_key_file=%s' % self.core_ci.ssh_key.key, + 'ansible_network_os=%s' % self.core_ci.platform, ] name = '%s-%s' % (self.core_ci.platform, self.core_ci.version.replace('.', '-'))