def remount(name, device, mkmnt=False, fstype='', opts='defaults', user=None):
 force_mount = False
 if (__grains__['os'] in ['MacOS', 'Darwin']):
  if (opts == 'defaults'):
   opts = 'noowners'
  if (fstype == 'smbfs'):
   force_mount = True
 if isinstance(opts, six.string_types):
  opts = opts.split(',')
 mnts = active()
 if (name in mnts):
  if (('remount' not in opts) and (__grains__['os'] not in ['OpenBSD', 'MacOS', 'Darwin'])):
   opts.append('remount')
  if force_mount:
   umount(name, device, user=user)
  lopts = ','.join(opts)
  args = '-o {0}'.format(lopts)
  if fstype:
   args += ' -t {0}'.format(fstype)
  if ((__grains__['os'] not in ['OpenBSD', 'MacOS', 'Darwin']) or force_mount):
   cmd = 'mount {0} {1} {2} '.format(args, device, name)
  else:
   cmd = 'mount -u {0} {1} {2} '.format(args, device, name)
  out = __salt__['cmd.run_all'](cmd, runas=user, python_shell=False)
  if out['retcode']:
   return out['stderr']
  return True
 return mount(name, device, mkmnt, fstype, opts, user=user)

def remount ( name , device , mkmnt = False , fstype = '' , opts = 'defaults' , user = None ) : force_mount = False if ( __grains__ [ 'os' ] in [ 'MacOS' , 'Darwin' ] ) : if ( opts == 'defaults' ) : opts = 'noowners' if ( fstype == 'smbfs' ) : force_mount = True if isinstance ( opts , six . string_types ) : opts = opts . split ( ',' ) mnts = active ( ) if ( name in mnts ) : if ( ( 'remount' not in opts ) and ( __grains__ [ 'os' ] not in [ 'OpenBSD' , 'MacOS' , 'Darwin' ] ) ) : opts . append ( 'remount' ) if force_mount : umount ( name , device , user = user ) lopts = ',' . join ( opts ) args = '-o {0}' . format ( lopts ) if fstype : args += ' -t {0}' . format ( fstype ) if ( ( __grains__ [ 'os' ] not in [ 'OpenBSD' , 'MacOS' , 'Darwin' ] ) or force_mount ) : cmd = 'mount {0} {1} {2} ' . format ( args , device , name ) else : cmd = 'mount -u {0} {1} {2} ' . format ( args , device , name ) out = __salt__ [ 'cmd.run_all' ] ( cmd , runas = user , python_shell = False ) if out [ 'retcode' ] : return out [ 'stderr' ] return True return mount ( name , device , mkmnt , fstype , opts , user = user )
remounts the filesystem as writable .