code: def _write_exports(exports, edict):
      '''
      Write an exports file to disk
  
      If multiple shares were initially configured per line, like:
  
          /media/storage /media/data *(ro,sync,no_subtree_check)
  
      ...then they will be saved to disk with only one share per line:
  
          /media/storage *(ro,sync,no_subtree_check)
          /media/data *(ro,sync,no_subtree_check)
      '''
      with salt.utils.files.fopen(exports, 'w') as efh:
          for export in edict:
              line = salt.utils.stringutils.to_str(export)
              for perms in edict[export]:
                  hosts = perms['hosts']
                  options = ','.join(perms['options'])
                  line += ' {0}({1})'.format(hosts, options)
              efh.write('{0}\n'.format(line)f _write_exports(exports, edict):
      '''
      Write an exports file to disk
  
      If multiple shares were initially configured per line, like:
  
          /media/storage /media/data *(ro,sync,no_subtree_check)
  
      ...then they will be saved to disk with only one share per line:
  
          /media/storage *(ro,sync,no_subtree_check)
          /media/data *(ro,sync,no_subtree_check)
      '''
      with salt.utils.files.fopen(exports, 'w') as efh:
          for export in edict:
              line = salt.utils.stringutils.to_str(export)
              for perms in edict[export]:
                  hosts = perms['hosts']
                  options = ','.join(perms['options'])
                  line += ' {0}({1})'.format(hosts, options)
              efh.write('{0}\n'.format(line))
docs: Write an exports file to disk
  
      If multiple shares were initially configured per line, like:
  
          /media/storage /media/data *(ro,sync,no_subtree_check)
  
      ...then they will be saved to disk with only one share per line:
  
          /media/storage *(ro,sync,no_subtree_check)
          /media/data *(ro,sync,no_subtree_check)