fixes saltstack/salt#64420 'unable to unmount' failure should return False result

This commit is contained in:
nicholasmhughes 2023-06-04 15:59:37 -04:00 committed by Megan Wilhite
parent 41d9f33c3f
commit d988dfb5b2
3 changed files with 4 additions and 3 deletions

1
changelog/64420.fixed.md Normal file
View file

@ -0,0 +1 @@
Fix 'unable to unmount' failure to return False result instead of None

View file

@ -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:

View file

@ -94,7 +94,7 @@ def test_mounted():
ret.update(
{
"comment": comt,
"result": None,
"result": False,
"changes": {"umount": umount1},
}
)
@ -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}):