Skip to content

Commit

Permalink
✨ Add module check mode for started state (#18)
Browse files Browse the repository at this point in the history
Prior to this patch, it was attempting to do actual mutation
unconditionally.
  • Loading branch information
webknjaz authored Feb 17, 2023
1 parent 8508b70 commit 653c9ad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/modules/parallels_desktop.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,13 +594,15 @@ def ensure_app_started( # noqa: WPS231
try:
parallels_pid = self.get_parallels_pid()
except LookupError:
parallels_pid = -1
spawn_parallels_cmd = 'open', '-a', 'Parallels Desktop', '--hide'
# NOTE: This may error out with rc=1 and the following stderr:
# NOTE: "LSOpenURLsWithRole() failed for the application
# NOTE: /Applications/Parallels Desktop.app with error -610.\n"

self.run_with_raise(spawn_parallels_cmd)
parallels_pid = self.get_parallels_pid()
if not self.check_mode:
self.run_with_raise(spawn_parallels_cmd)
parallels_pid = self.get_parallels_pid()

return {
'msg': 'The {app!s} app (process: `{proc!s}`; '
Expand Down

0 comments on commit 653c9ad

Please sign in to comment.