Closed martin-res closed 2 years ago
Problem: Login freezes if CUPS is not a local CUPS and user has AD-printers use timeout with e.g. 5 seconds File: printers.py
def _installPrinter(username, networkPath, name): logging.debug("_installPrinter Printer {0} on {1}".format(name, networkPath)) installCommand = ["timeout", "5", "lpadmin", "-p", name, "-E", "-v", networkPath, "-m", "everywhere", "-u", f"allow:{username}"] logging.debug("* running '{}'".format(" ".join(installCommand))) p = subprocess.Popen(installCommand, stdout=subprocess.PIPE, stderr=subprocess.PIPE) output, error = p.communicate() if p.returncode == 0: logging.debug("* Success _installPrinter!") return True elif p.returncode == 124: logging.debug("* Error Timeout lpadmin") else: logging.debug(f"* Error installing printer {name} on {networkPath}!\n") logging.debug(f"* stderr: {error}") return False
Hi @martin-res
I am currently very busy, and cannot implement this myself. But if you submit a pull request, I'd be happy to review it :)
regards, Dorian
Problem: Login freezes if CUPS is not a local CUPS and user has AD-printers use timeout with e.g. 5 seconds File: printers.py