def set_master(service, conn_type, private='y', unpriv='y', chroot='y', wakeup='n', maxproc='100', command='', write_conf=True, path=MASTER_CF):
 (conf_dict, conf_list) = _parse_master(path)
 new_conf = []
 dict_key = '{0} {1}'.format(service, conn_type)
 new_line = _format_master(service, conn_type, private, unpriv, chroot, wakeup, maxproc, command)
 for line in conf_list:
  if isinstance(line, dict):
   if ((line['service'] == service) and (line['conn_type'] == conn_type)):
    new_conf.append(new_line)
   else:
    new_conf.append(_format_master(**line))
  else:
   new_conf.append(line)
 if (dict_key not in conf_dict):
  new_conf.append(new_line)
 if write_conf:
  _write_conf(new_conf, path)
 return '\n'.join(new_conf)

def set_master ( service , conn_type , private = 'y' , unpriv = 'y' , chroot = 'y' , wakeup = 'n' , maxproc = '100' , command = '' , write_conf = True , path = MASTER_CF ) : ( conf_dict , conf_list ) = _parse_master ( path ) new_conf = [ ] dict_key = '{0} {1}' . format ( service , conn_type ) new_line = _format_master ( service , conn_type , private , unpriv , chroot , wakeup , maxproc , command ) for line in conf_list : if isinstance ( line , dict ) : if ( ( line [ 'service' ] == service ) and ( line [ 'conn_type' ] == conn_type ) ) : new_conf . append ( new_line ) else : new_conf . append ( _format_master ( ** line ) ) else : new_conf . append ( line ) if ( dict_key not in conf_dict ) : new_conf . append ( new_line ) if write_conf : _write_conf ( new_conf , path ) return '\n' . join ( new_conf )
set a single config value in the master .