Skip to content

Commit

Permalink
fixes saltstack#64420 'unable to unmount' failure should return False…
Browse files Browse the repository at this point in the history
… result
  • Loading branch information
nicholasmhughes committed Jun 4, 2023
1 parent 41d9f33 commit 0e3781e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog/64420.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix 'unable to unmount' failure to return False result instead of None
2 changes: 1 addition & 1 deletion salt/states/mount.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ def mounted(
active = __salt__["mount.active"](extended=True)
if comp_real_name in active:
ret["comment"] = "Unable to unmount"
ret["result"] = None
ret["result"] = False
return ret
update_mount_cache = True
else:
Expand Down
4 changes: 2 additions & 2 deletions tests/pytests/unit/states/test_mount.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def test_mounted():
ret.update(
{
"comment": comt,
"result": None,
"result": False,
"changes": {"umount": umount1},
}
)
Expand All @@ -115,7 +115,7 @@ def test_mounted():
"os.path.exists", MagicMock(return_value=False)
):
comt = "{} does not exist and would not be created".format(name)
ret.update({"comment": comt, "changes": {}})
ret.update({"comment": comt, "changes": {}, "result": None})
assert mount.mounted(name, device, fstype) == ret

with patch.dict(mount.__opts__, {"test": False}):
Expand Down

0 comments on commit 0e3781e

Please sign in to comment.