def unset_mount(module, args):
 to_write = []
 changed = False
 escaped_name = _escape_fstab(args['name'])
 for line in open(args['fstab'], 'r').readlines():
  if (not line.strip()):
   to_write.append(line)
   continue
  if line.strip().startswith('#'):
   to_write.append(line)
   continue
  if (((get_platform() == 'SunOS') and (len(line.split()) != 7)) or ((get_platform() != 'SunOS') and (len(line.split()) != 6))):
   to_write.append(line)
   continue
  ld = {}
  if (get_platform() == 'SunOS'):
   (ld['src'], dash, ld['name'], ld['fstype'], ld['passno'], ld['boot'], ld['opts']) = line.split()
  else:
   (ld['src'], ld['name'], ld['fstype'], ld['opts'], ld['dump'], ld['passno']) = line.split()
  if (ld['name'] != escaped_name):
   to_write.append(line)
   continue
  changed = True
 if (changed and (not module.check_mode)):
  write_fstab(to_write, args['fstab'])
 return (args['name'], changed)

def unset_mount ( module , args ) : to_write = [ ] changed = False escaped_name = _escape_fstab ( args [ 'name' ] ) for line in open ( args [ 'fstab' ] , 'r' ) . readlines ( ) : if ( not line . strip ( ) ) : to_write . append ( line ) continue if line . strip ( ) . startswith ( '#' ) : to_write . append ( line ) continue if ( ( ( get_platform ( ) == 'SunOS' ) and ( len ( line . split ( ) ) != 7 ) ) or ( ( get_platform ( ) != 'SunOS' ) and ( len ( line . split ( ) ) != 6 ) ) ) : to_write . append ( line ) continue ld = { } if ( get_platform ( ) == 'SunOS' ) : ( ld [ 'src' ] , dash , ld [ 'name' ] , ld [ 'fstype' ] , ld [ 'passno' ] , ld [ 'boot' ] , ld [ 'opts' ] ) = line . split ( ) else : ( ld [ 'src' ] , ld [ 'name' ] , ld [ 'fstype' ] , ld [ 'opts' ] , ld [ 'dump' ] , ld [ 'passno' ] ) = line . split ( ) if ( ld [ 'name' ] != escaped_name ) : to_write . append ( line ) continue changed = True if ( changed and ( not module . check_mode ) ) : write_fstab ( to_write , args [ 'fstab' ] ) return ( args [ 'name' ] , changed )
remove a mount point from fstab .