www.cendio.com

Bug 5954

Summary: tl-setup imports system subprocess.py, incompatible with subprocess.py from python 2.4
Product: ThinLinc Reporter: Karl Mikaelsson <derfian@cendio.se>
Component: Server InstallerAssignee: Karl Mikaelsson <derfian@cendio.se>
Status: CLOSED FIXED QA Contact: Bugzilla mail exporter <bugzilla-qa@cendio.se>
Severity: Normal    
Priority: P2 CC: ossman@cendio.se, samuel@cendio.se
Version: 4.6.0Keywords: relnotes, samuel_tester, thomas_tester
Target Milestone: 4.7.0   
Hardware: PC   
OS: Unknown   
Acceptance Criteria:

Description From cendio 2016-08-01 16:25:48
We got reports about problems from someone who tried to upgrade their ThinLinc
4.2.0 to ThinLinc 4.6.0 on a system identifying as RHEL5. Here's the relevant
errors from tlsetup.log:

> 2016-08-01 13:17:33,029: Configuration migration option: parameter
> 2016-08-01 13:17:33,031: Traceback (most recent call last):
> 2016-08-01 13:17:33,031:   File "/opt/thinlinc/sbin/../libexec/tl-setup.py", line 506, in i11I1I1I
> 2016-08-01 13:17:33,031:     oOOOo00O00O = o0o ( )
> 2016-08-01 13:17:33,031:   File "/opt/thinlinc/sbin/../libexec/tl-setup.py", line 388, in o0o
> 2016-08-01 13:17:33,031:     oOooO ( False ) ;
> 2016-08-01 13:17:33,031:   File "/opt/thinlinc/sbin/../libexec/tl-setup.py", line 423, in oOooO
> 2016-08-01 13:17:33,031:     II11Ii1iI1iII ( ii , oOO00oOO )
> 2016-08-01 13:17:33,031:   File "/opt/thinlinc/sbin/../libexec/tl-setup.py", line 367, in II11Ii1iI1iII
> 2016-08-01 13:17:33,031:     except subprocess . CalledProcessError , IiIIIiI1I1 :
> 2016-08-01 13:17:33,031: AttributeError: 'module' object has no attribute 'CalledProcessError'
------- Comment #1 From cendio 2016-08-01 16:28:30 -------
One "solution" to this is to implement bug 5657 - i.e. raise the system
requirements to Python 2.5. This would force us to drop support for RHEL5
though.
------- Comment #2 From cendio 2016-08-01 17:10:32 -------
We should perhaps (In reply to comment #1)
> One "solution" to this is to implement bug 5657 - i.e. raise the system
> requirements to Python 2.5. This would force us to drop support for RHEL5
> though.

This problem has an easier and more customer-friendly solution:

We already ship our own subprocess.py that includes the CalledProcessError
exception and check_call call, but tl-setup imports subprocess before modifying
sys.path. Most other scripts I've found first modify sys.path and then import
subprocess - the lone exception here seems to be tl-ldap-certaliases, which
probably should be fixed to behave the same way.
------- Comment #3 From cendio 2016-08-01 17:35:32 -------
Another way would be to rewrite the offending code to be 2.4-compatible.
Discussing bug 4120 could prove helpful prior to this decision.
------- Comment #7 From cendio 2016-08-09 13:32:58 -------
tl-ldap-certalias was also using the system subprocess, although it was
compatible with subprocess from Python 2.4. I've changed both scripts to use
our bundled subprocess.
------- Comment #8 From cendio 2016-08-10 11:03:42 -------
Looks good!

Verified that we encountered the problem on RHEL5 when upgrading from 4.5.0 to
4.6.0 and that when upgrading to a nightly build it is fixed. Can't find any
other place in ThinLinc which uses the system's subprocess.