def _parse_master(path=MASTER_CF):
 with salt.utils.fopen(path, 'r') as fh_:
  full_conf = fh_.read()
 conf_list = []
 conf_dict = {}
 for line in full_conf.splitlines():
  if ((not line.strip()) or line.strip().startswith('#')):
   conf_list.append(line)
   continue
  comps = line.strip().split()
  conf_line = {'service': comps[0], 'conn_type': comps[1], 'private': comps[2], 'unpriv': comps[3], 'chroot': comps[4], 'wakeup': comps[5], 'maxproc': comps[6], 'command': ' '.join(comps[7:])}
  dict_key = '{0} {1}'.format(comps[0], comps[1])
  conf_list.append(conf_line)
  conf_dict[dict_key] = conf_line
 return (conf_dict, conf_list)

def _parse_master ( path = MASTER_CF ) : with salt . utils . fopen ( path , 'r' ) as fh_ : full_conf = fh_ . read ( ) conf_list = [ ] conf_dict = { } for line in full_conf . splitlines ( ) : if ( ( not line . strip ( ) ) or line . strip ( ) . startswith ( '#' ) ) : conf_list . append ( line ) continue comps = line . strip ( ) . split ( ) conf_line = { 'service' : comps [ 0 ] , 'conn_type' : comps [ 1 ] , 'private' : comps [ 2 ] , 'unpriv' : comps [ 3 ] , 'chroot' : comps [ 4 ] , 'wakeup' : comps [ 5 ] , 'maxproc' : comps [ 6 ] , 'command' : ' ' . join ( comps [ 7 : ] ) } dict_key = '{0} {1}' . format ( comps [ 0 ] , comps [ 1 ] ) conf_list . append ( conf_line ) conf_dict [ dict_key ] = conf_line return ( conf_dict , conf_list )
parse the master .