Merge pull request #39276 from gtmanfred/2016.11

_device_mismatch_ignored will never be True
This commit is contained in:
Mike Place 2017-02-09 10:05:27 -07:00 committed by GitHub
commit 304eb19b18

View file

@ -412,18 +412,19 @@ def mounted(name,
opts.remove('remount')
if real_device not in device_list:
# name matches but device doesn't - need to umount
_device_mismatch_is_ignored = False
_device_mismatch_is_ignored = None
for regex in list(device_name_regex):
for _device in device_list:
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 is True:
ret['result'] = None
elif _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