mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-24 12:49:03 +00:00
modules: update code to python3 (#10904)
* modules: update code to python3 * pamd: rollback changes * add changelog frag * fix/improve assignments using generators * Update plugins/modules/launchd.py Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
c5253c5007
commit
3b83df3f79
29 changed files with 113 additions and 86 deletions
|
|
@ -91,7 +91,7 @@ class CapabilitiesModule(object):
|
|||
self.module.exit_json(changed=True, msg='capabilities changed')
|
||||
else:
|
||||
# remove from current cap list if it is already set (but op/flags differ)
|
||||
current = list(filter(lambda x: x[0] != self.capability_tup[0], current))
|
||||
current = [x for x in current if x[0] != self.capability_tup[0]]
|
||||
# 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))
|
||||
|
|
@ -101,7 +101,7 @@ class CapabilitiesModule(object):
|
|||
self.module.exit_json(changed=True, msg='capabilities changed')
|
||||
else:
|
||||
# remove from current cap list and then set current list
|
||||
current = filter(lambda x: x[0] != self.capability_tup[0], current)
|
||||
current = [x for x in current if x[0] != self.capability_tup[0]]
|
||||
self.module.exit_json(changed=True, state=self.state, msg='capabilities changed', stdout=self.setcap(self.path, current))
|
||||
self.module.exit_json(changed=False, state=self.state)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue