Set the ansible_ssh_port variable instead of saving it internally for Host

Fixes #11330
This commit is contained in:
Benno Joy 2015-06-22 00:37:44 -04:00 committed by James Cammarata
parent 5a02ea5f2b
commit f17bdc4d61

View file

@ -49,7 +49,6 @@ class Host:
vars=self.vars.copy(),
ipv4_address=self.ipv4_address,
ipv6_address=self.ipv6_address,
port=self.port,
gathered_facts=self._gathered_facts,
groups=groups,
)
@ -61,7 +60,6 @@ class Host:
self.vars = data.get('vars', dict())
self.ipv4_address = data.get('ipv4_address', '')
self.ipv6_address = data.get('ipv6_address', '')
self.port = data.get('port')
groups = data.get('groups', [])
for group_data in groups:
@ -79,9 +77,9 @@ class Host:
self.ipv6_address = name
if port and port != C.DEFAULT_REMOTE_PORT:
self.port = int(port)
self.set_variable('ansible_ssh_port', int(port))
else:
self.port = C.DEFAULT_REMOTE_PORT
self.set_variable('ansible_ssh_port', C.DEFAULT_REMOTE_PORT)
self._gathered_facts = False