mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Merge pull request #50409 from casselt/mount-device_name_regex-test-mode-fix
Fix test mode for mount state if device_name_regex is used.
This commit is contained in:
commit
d2fc910d59
@ -515,16 +515,16 @@ def mounted(name,
|
||||
if re.match(regex, _device):
|
||||
_device_mismatch_is_ignored = _device
|
||||
break
|
||||
if __opts__['test']:
|
||||
ret['result'] = None
|
||||
ret['comment'] = "An umount would have been forced " \
|
||||
+ "because devices do not match. Watched: " \
|
||||
+ device
|
||||
elif _device_mismatch_is_ignored:
|
||||
if _device_mismatch_is_ignored:
|
||||
ret['result'] = True
|
||||
ret['comment'] = "An umount will not be forced " \
|
||||
+ "because device matched device_name_regex: " \
|
||||
+ _device_mismatch_is_ignored
|
||||
elif __opts__['test']:
|
||||
ret['result'] = None
|
||||
ret['comment'] = "An umount would have been forced " \
|
||||
+ "because devices do not match. Watched: " \
|
||||
+ device
|
||||
else:
|
||||
ret['changes']['umount'] = "Forced unmount because devices " \
|
||||
+ "don't match. Wanted: " + device
|
||||
|
Loading…
Reference in New Issue
Block a user