Rename ssh_port to connection_port

With the upcoming windows support we don't have ssh as the only
connection type. As a preparation for this generalize ssh_port to
connection_port.

Change-Id: Ie505fedea7b641a860b7ac4f834d96ce5351dd74
Depends-On: Ic1939054f0604411e0122db8dbd7e9886ceaa974
This commit is contained in:
Tobias Henkel 2017-09-05 14:36:33 +02:00
parent 3934e3f769
commit aea43445b7
3 changed files with 5 additions and 5 deletions

View File

@ -416,15 +416,15 @@ class TestAnsibleJob(ZuulTestCase):
job) job)
def test_getHostList_host_keys(self): def test_getHostList_host_keys(self):
# Test without ssh_port set # Test without connection_port set
node = {'name': 'fake-host', node = {'name': 'fake-host',
'host_keys': ['fake-host-key'], 'host_keys': ['fake-host-key'],
'interface_ip': 'localhost'} 'interface_ip': 'localhost'}
keys = self.test_job.getHostList({'nodes': [node]})[0]['host_keys'] keys = self.test_job.getHostList({'nodes': [node]})[0]['host_keys']
self.assertEqual(keys[0], 'localhost fake-host-key') self.assertEqual(keys[0], 'localhost fake-host-key')
# Test with custom ssh_port set # Test with custom connection_port set
node['ssh_port'] = 22022 node['connection_port'] = 22022
keys = self.test_job.getHostList({'nodes': [node]})[0]['host_keys'] keys = self.test_job.getHostList({'nodes': [node]})[0]['host_keys']
self.assertEqual(keys[0], '[localhost]:22022 fake-host-key') self.assertEqual(keys[0], '[localhost]:22022 fake-host-key')

View File

@ -911,7 +911,7 @@ class AnsibleJob(object):
# results in the wrong thing being in interface_ip # results in the wrong thing being in interface_ip
# TODO(jeblair): Move this notice to the docs. # TODO(jeblair): Move this notice to the docs.
ip = node.get('interface_ip') ip = node.get('interface_ip')
port = node.get('ssh_port', 22) port = node.get('connection_port', node.get('ssh_port', 22))
host_vars = dict( host_vars = dict(
ansible_host=ip, ansible_host=ip,
ansible_user=self.executor_server.default_username, ansible_user=self.executor_server.default_username,

View File

@ -383,7 +383,7 @@ class Node(object):
self.public_ipv4 = None self.public_ipv4 = None
self.private_ipv4 = None self.private_ipv4 = None
self.public_ipv6 = None self.public_ipv6 = None
self.ssh_port = 22 self.connection_port = 22
self._keys = [] self._keys = []
self.az = None self.az = None
self.provider = None self.provider = None