Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8b2bd3e

Browse files
committed
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
1 parent 30a31e8 commit 8b2bd3e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

packaging/openbsd_pkg.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,15 @@ def upgrade_packages(module):
336336

337337
# Try to find any occurance of a package changing version like:
338338
# "bzip2-1.0.6->1.0.6p0: ok".
339-
changed = re.search("\W\w.+->.+: ok\W", stdout)
340-
if module.check_mode:
341-
module.exit_json(changed=changed)
339+
match = re.search("\W\w.+->.+: ok\W", stdout)
340+
if match:
341+
if module.check_mode:
342+
module.exit_json(changed=True)
343+
344+
changed=True
345+
346+
else:
347+
changed=False
342348

343349
# It seems we can not trust the return value, so depend on the presence of
344350
# stderr to know if something failed.

0 commit comments

Comments
 (0)