From d75e707af595d99863540b6c5f8462b2c242f0e8 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Thu, 19 Nov 2015 09:55:06 -0800 Subject: [PATCH] Simplify code a little --- lib/ansible/plugins/action/synchronize.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/ansible/plugins/action/synchronize.py b/lib/ansible/plugins/action/synchronize.py index 9bf12132ede..45004d5ed4e 100644 --- a/lib/ansible/plugins/action/synchronize.py +++ b/lib/ansible/plugins/action/synchronize.py @@ -134,10 +134,7 @@ class ActionModule(ActionBase): try: dest_host = dest_host_inventory_vars['ansible_host'] except KeyError: - try: - dest_host = dest_host_inventory_vars['ansible_ssh_host'] - except KeyError: - dest_host = inventory_hostname + dest_host = dest_host_inventory_vars.get('ansible_ssh_host', inventory_hostname) dest_is_local = dest_host in C.LOCALHOST