1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix logic.

This commit is contained in:
Felix Fontein 2021-06-30 20:59:08 +02:00
parent 92ce96d272
commit fb707f3b52

View file

@ -196,7 +196,7 @@ class Snap(CmdStateModuleHelper):
self.validate_input_snaps() # if snap doesnt exist, it will explode when trying to install
self.vars.meta('classic').set(output=True)
self.vars.meta('channel').set(output=True)
actionable_snaps = [s for s in self.vars.name if self.is_snap_installed(s)]
actionable_snaps = [s for s in self.vars.name if not self.is_snap_installed(s)]
if not actionable_snaps:
return
self.changed = True
@ -227,7 +227,7 @@ class Snap(CmdStateModuleHelper):
def state_absent(self):
self.validate_input_snaps() # if snap doesnt exist, it will be absent by definition
actionable_snaps = [s for s in self.vars.name if not self.is_snap_installed(s)]
actionable_snaps = [s for s in self.vars.name if self.is_snap_installed(s)]
if not actionable_snaps:
return
self.changed = True