1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Port integration tests to network_cli (#33583)

* network_cli needs network_os

* Work around for Python 3.x < 3.6
This commit is contained in:
Nathaniel Case 2017-12-05 12:46:00 -05:00 committed by GitHub
parent 09b3b5305a
commit 8679d2e396
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View file

@ -818,9 +818,9 @@ class TaskExecutor:
stdin.close() stdin.close()
if p.returncode == 0: if p.returncode == 0:
result = json.loads(stdout) result = json.loads(to_text(stdout))
else: else:
result = json.loads(stderr) result = json.loads(to_text(stderr))
if 'messages' in result: if 'messages' in result:
for msg in result.get('messages'): for msg in result.get('messages'):

View file

@ -72,11 +72,17 @@ class ManageNetworkCI(object):
def wait(self): def wait(self):
"""Wait for instance to respond to ansible ping.""" """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 = [ extra_vars = [
'ansible_host=%s' % self.core_ci.connection.hostname, 'ansible_host=%s' % self.core_ci.connection.hostname,
'ansible_port=%s' % self.core_ci.connection.port, '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_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('.', '-')) name = '%s-%s' % (self.core_ci.platform, self.core_ci.version.replace('.', '-'))