add hidden_opts to mount.mounted

Fixes #28603.
This commit is contained in:
Justin Findlay 2015-11-06 23:29:47 -07:00
parent d3aff8f6b8
commit 1dcaa8e1d7

View file

@ -50,7 +50,8 @@ def mounted(name,
persist=True,
mount=True,
user=None,
match_on='auto'):
match_on='auto',
hidden_opts=None):
'''
Verify that a device is mounted
@ -96,6 +97,12 @@ def mounted(name,
Default is ``auto``, a special value indicating to guess based on fstype.
In general, ``auto`` matches on name for recognized special devices and
device otherwise.
hidden_opts
A list of mount options that will be ignored when considering a remount
as part of the state application
.. versionadded:: 2015.8.2
'''
ret = {'name': name,
'changes': {},
@ -111,6 +118,9 @@ def mounted(name,
if isinstance(opts, string_types):
opts = opts.split(',')
if isinstance(hidden_opts, string_types):
hidden_opts = hidden_opts.split(',')
# remove possible trailing slash
if not name == '/':
name = name.rstrip('/')
@ -220,6 +230,8 @@ def mounted(name,
'port',
'backup-volfile-servers',
]
if hidden_opts:
mount_invisible_options = list(set(mount_invisible_options) | set(hidden_opts))
# options which are provided as key=value (e.g. password=Zohp5ohb)
mount_invisible_keys = [
'actimeo',