Python fix to the connection issue

Instead of having a conditional, we should directly use python .get()
internals, that allow to have a default.

Change-Id: I9908e83e3faa2fcc22c891c0fd6caa1fd8e92cc4
Related-Bug: 1695944
(cherry picked from commit a556e38164)
This commit is contained in:
Jean-Philippe Evrard 2017-06-12 09:24:07 +00:00 committed by Jesse Pretorius
parent af204e4418
commit e9ce8422b4

View File

@ -64,9 +64,8 @@ class Connection(SSH.Connection):
def set_host_overrides(self, host, hostvars=None):
if self._container_check() or self._chroot_check():
physical_host_addr = hostvars.get('physical_host_addr')
if not physical_host_addr:
physical_host_addr = self.physical_host
physical_host_addr = hostvars.get('physical_host_addr',
self.physical_host)
self.host = self._play_context.remote_addr = physical_host_addr
def _exec_command(self, cmd, in_data=None, sudoable=True):