[26607] in Source-Commits

home help back first fref pref prev next nref lref last post

Re: /svn/athena r25649 - in trunk/debathena/config/printing-config:

daemon@ATHENA.MIT.EDU (Jonathan Reed)
Fri Jul 20 17:23:43 2012

Date: Fri, 20 Jul 2012 17:23:41 -0400 (EDT)
From: Jonathan Reed <jdreed@MIT.EDU>
To: source-commits@MIT.EDU
In-Reply-To: <201207202122.q6KLM3lb002245@drugstore.mit.edu>
Message-ID: <alpine.DEB.2.02.1207201722420.25158@INFINITE-LOOP.MIT.EDU>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

A typo resulted in an empty commit message.

This depends on the new getcluster and parses its plaintext output, so as 
to avoid shell quoting issues and the security risks in eval'ing 
"untrusted" sources.

On Fri, 20 Jul 2012, Jonathan D Reed wrote:

> Author: jdreed
> Date: 2012-07-20 17:22:03 -0400 (Fri, 20 Jul 2012)
> New Revision: 25649
>
> Modified:
>   trunk/debathena/config/printing-config/debathena/printing/common.py
>   trunk/debathena/config/printing-config/debian/control
> Log:
>
>
> Modified: trunk/debathena/config/printing-config/debathena/printing/common.py
> ===================================================================
> --- trunk/debathena/config/printing-config/debathena/printing/common.py	2012-07-20 21:12:30 UTC (rev 25648)
> +++ trunk/debathena/config/printing-config/debathena/printing/common.py	2012-07-20 21:22:03 UTC (rev 25649)
> @@ -153,9 +153,13 @@
>         if default:
>             return default
>
> -    hesprinter = subprocess.Popen("eval $(getcluster -b $(lsb_release -sr)) && echo $LPR", stdout=subprocess.PIPE, shell=True).communicate()[0]
> -    if hesprinter:
> -        return hesprinter.strip()
> +    clusterinfo = subprocess.Popen("getcluster -p $(lsb_release -sr)",
> +                                   stdout=subprocess.PIPE,
> +                                   shell=True).communicate()[0]
> +    for line in clusterinfo.splitlines():
> +        (k,v) = line.split(None, 1)
> +        if k == "LPR":
> +            return v.strip()
>
>
> def is_local(queue):
>
> Modified: trunk/debathena/config/printing-config/debian/control
> ===================================================================
> --- trunk/debathena/config/printing-config/debian/control	2012-07-20 21:12:30 UTC (rev 25648)
> +++ trunk/debathena/config/printing-config/debian/control	2012-07-20 21:22:03 UTC (rev 25649)
> @@ -7,7 +7,7 @@
>
> Package: debathena-printing-config
> Architecture: all
> -Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, debathena-cupsys-config, debathena-hesiod-config, debathena-lprng-config, debathena-lprng, cups-bsd | cupsys-bsd, python, python-hesiod, python-cups, python-pkg-resources
> +Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, debathena-cupsys-config, debathena-hesiod-config, debathena-lprng-config, debathena-lprng, cups-bsd | cupsys-bsd, python, python-hesiod, python-cups, python-pkg-resources, debathena-getcluster (>= 10.1.0-0debathena1)
> Recommends: debathena-apparmor-config
> Provides: ${diverted-files}
> Conflicts: ${diverted-files}
>
>

home help back first fref pref prev next nref lref last post