From b146ba37da4f7fb657afa6ccad65b75774f506af Mon Sep 17 00:00:00 2001 From: Catatonic Date: Fri, 18 Aug 2017 11:24:33 -0700 Subject: [PATCH] Update capabilities.py (#23879) Fixes issue when using python3 interpreter: 'filter' object has no attribute 'append' Ensure list type of data is used before appending data. --- lib/ansible/modules/system/capabilities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/system/capabilities.py b/lib/ansible/modules/system/capabilities.py index 6286909992d..6c62ee520b9 100644 --- a/lib/ansible/modules/system/capabilities.py +++ b/lib/ansible/modules/system/capabilities.py @@ -94,7 +94,7 @@ class CapabilitiesModule(object): self.module.exit_json(changed=True, msg='capabilities changed') else: # remove from current cap list if it's already set (but op/flags differ) - current = filter(lambda x: x[0] != self.capability_tup[0], current) + current = list(filter(lambda x: x[0] != self.capability_tup[0], current)) # add new cap with correct op/flags current.append( self.capability_tup ) self.module.exit_json(changed=True, state=self.state, msg='capabilities changed', stdout=self.setcap(self.path, current))