Skip to content

Commit

Permalink
Merge pull request #51911 from clallen/develop
Browse files Browse the repository at this point in the history
Solaris vfstab handling in states.mount
  • Loading branch information
dwoz authored Mar 5, 2019
2 parents 2de69b3 + 1388523 commit 30d798e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions salt/states/mount.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ def mounted(name,
if opts == 'defaults':
opts = ''

# Defaults is not a valid option on Solaris
if 'Solaris' in __grains__['os'] and opts == 'defaults':
opts = '-'

# Make sure that opts is correct, it can be a list or a comma delimited
# string
if isinstance(opts, string_types):
Expand Down Expand Up @@ -617,6 +621,14 @@ def mounted(name,
config,
test=True,
match_on=match_on)
elif 'Solaris' in __grains__['os']:
out = __salt__['mount.set_vfstab'](name,
device,
fstype,
opts,
config=config,
test=True,
match_on=match_on)
else:
out = __salt__['mount.set_fstab'](name,
device,
Expand Down Expand Up @@ -673,6 +685,13 @@ def mounted(name,
mount,
config,
match_on=match_on)
elif 'Solaris' in __grains__['os']:
out = __salt__['mount.set_vfstab'](name,
device,
fstype,
opts,
config=config,
match_on=match_on)
else:
out = __salt__['mount.set_fstab'](name,
device,
Expand Down Expand Up @@ -894,6 +913,10 @@ def unmounted(name,
if config == '/etc/fstab':
config = "/etc/filesystems"
fstab_data = __salt__['mount.filesystems'](config)
elif 'Solaris' in __grains__['os']:
if config == '/etc/fstab':
config = '/etc/vfstab'
fstab_data = __salt__['mount.vfstab'](config)
else:
fstab_data = __salt__['mount.fstab'](config)

Expand All @@ -915,6 +938,8 @@ def unmounted(name,
out = __salt__['mount.rm_automaster'](name, device, config)
elif 'AIX' in __grains__['os']:
out = __salt__['mount.rm_filesystems'](name, device, config)
elif 'Solaris' in __grains__['os']:
out = __salt__['mount.rm_vfstab'](name, device, config)
else:
out = __salt__['mount.rm_fstab'](name, device, config)
if out is not True:
Expand Down

0 comments on commit 30d798e

Please sign in to comment.