openbsd_pkg: revert "changed" simplification.

module.exit_json() does not like when the "changed" variable contains a
match object:

TypeError: <_sre.SRE_Match object at 0x81e2ae58> is not JSON serializable
pull/18777/head
Patrik Lundin 11 years ago committed by Matt Clay
parent 98dcb3a006
commit 66cb7f1a37

@ -336,9 +336,15 @@ def upgrade_packages(module):
# Try to find any occurance of a package changing version like:
# "bzip2-1.0.6->1.0.6p0: ok".
changed = re.search("\W\w.+->.+: ok\W", stdout)
match = re.search("\W\w.+->.+: ok\W", stdout)
if match:
if module.check_mode:
module.exit_json(changed=changed)
module.exit_json(changed=True)
changed=True
else:
changed=False
# It seems we can not trust the return value, so depend on the presence of
# stderr to know if something failed.

Loading…
Cancel
Save