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.
pull/24789/merge
Catatonic 7 years ago committed by ansibot
parent a31f4c178a
commit b146ba37da

@ -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))

Loading…
Cancel
Save