From 5cd56106c42482d9514e4f343fc0a8d7f60ce23a Mon Sep 17 00:00:00 2001 From: Jimmy McCrory Date: Tue, 12 Sep 2017 11:19:47 -0600 Subject: [PATCH] Make linear strategy plugin 2.4 compatible In Ansible 2.4, the InventoryManager 'get_group_dict' function was renamed to 'get_groups_dict' Change-Id: Ic758253af7b2fe742d253f363edeb2953130a2f5 --- strategy/linear.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/strategy/linear.py b/strategy/linear.py index f43c04d..f5e5fea 100644 --- a/strategy/linear.py +++ b/strategy/linear.py @@ -116,7 +116,10 @@ class StrategyModule(LINEAR.StrategyModule): _play_context = copy.deepcopy(play_context) - groups = self._inventory.get_group_dict() + try: + groups = self._inventory.get_groups_dict() + except AttributeError: + groups = self._inventory.get_group_dict() physical_hosts = groups.get('hosts', groups.get('all', {})) physical_host_addrs = {} for physical_host in physical_hosts: