From f7694ac433b11f5521ab36c886119387ebf404ef Mon Sep 17 00:00:00 2001 From: Silviu Dicu Date: Wed, 23 Jan 2013 11:43:24 -0500 Subject: [PATCH] lambda fails on attribute access - g.name is a string not the group object --- lib/ansible/inventory/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/inventory/__init__.py b/lib/ansible/inventory/__init__.py index 55dbd921c03..076bc708768 100644 --- a/lib/ansible/inventory/__init__.py +++ b/lib/ansible/inventory/__init__.py @@ -296,7 +296,7 @@ class Inventory(object): return [ h.name for h in self.get_hosts(pattern) ] def list_groups(self): - return sorted([ g.name for g in self.groups ], key=lambda x: x.name) + return sorted([ g.name for g in self.groups ], key=lambda x: x) # TODO: remove this function def get_restriction(self):