(pipesize)
Tune the maximum size of pipes
Tune the maximum size of pipes
Tune the maximum size of pipes
def _tune_max_pipe_size(pipesize):
    """Tune the maximum size of pipes"""
    if (not which("sysctl")):
        logging.error("Couldn't tune max-pipe-size. Please check how to tune "
                      "it in your OS.")
        return False

    ret = subprocess.check_output(["sysctl", "fs.pipe-max-size"])
    current_max = int(ret.decode().split()[-1])

    if (current_max < pipesize):
        cmd = ["sysctl", "-w", "fs.pipe-max-size=" + str(pipesize)]
        print(
            textwrap.fill("The maximum pipe size that is currently "
                          "configured in your OS is of {} bytes, which is "
                          "not sufficient for the receiver application. "
                          "It will be necessary to run the following command "
                          "as root:".format(current_max),
                          width=80))
        print("\n" + " ".join(cmd) + "\n")

        if (not util.ask_yes_or_no("Is that OK?", default="y")):
            print("Abort")
            return False

        res = runner.run(cmd, root=True)
        return (res.returncode == 0)
    else:
        return True
def _tune_max_pipe_size ( pipesize ) : if ( not which ( "sysctl" ) ) : logging . error ( "Couldn't tune max-pipe-size. Please check how to tune " "it in your OS." ) return False ret = subprocess . check_output ( [ "sysctl" , "fs.pipe-max-size" ] ) current_max = int ( ret . decode ( ) . split ( ) [ - 1 ] ) if ( current_max < pipesize ) : cmd = [ "sysctl" , "-w" , "fs.pipe-max-size=" + str ( pipesize ) ] print ( textwrap . fill ( "The maximum pipe size that is currently " "configured in your OS is of {} bytes, which is " "not sufficient for the receiver application. " "It will be necessary to run the following command " "as root:" . format ( current_max ) , width = 80 ) ) print ( "\n" + " " . join ( cmd ) + "\n" ) if ( not util . ask_yes_or_no ( "Is that OK?" , default = "y" ) ) : print ( "Abort" ) return False res = runner . run ( cmd , root = True ) return ( res . returncode == 0 ) else : return True