def chown_log_dir(uid, gid):
 if (_log_dir is None):
  return False
 try:
  os.chown(_log_dir, uid, gid)
  for entry in os.listdir(_log_dir):
   os.chown(os.path.join(_log_dir, entry), uid, gid)
  return True
 except OSError as ex:
  print >>sys.stderr, ('Failed to chown log directory %s: ex' % (_log_dir, ex))
  return False

def chown_log_dir ( uid , gid ) : if ( _log_dir is None ) : return False try : os . chown ( _log_dir , uid , gid ) for entry in os . listdir ( _log_dir ) : os . chown ( os . path . join ( _log_dir , entry ) , uid , gid ) return True except OSError as ex : print >> sys . stderr , ( 'Failed to chown log directory %s: ex' % ( _log_dir , ex ) ) return False
chown all files in the log dir to this user and group .