Bug 5954 - tl-setup imports system subprocess.py, incompatible with subprocess.py from python 2.4
Summary: tl-setup imports system subprocess.py, incompatible with subprocess.py from p...
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Server Installer (show other bugs)
Version: 4.6.0
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.7.0
Assignee: Karl Mikaelsson
URL:
Keywords: relnotes, samuel_tester, thomas_tester
Depends on:
Blocks:
 
Reported: 2016-08-01 16:25 CEST by Karl Mikaelsson
Modified: 2016-09-23 10:13 CEST (History)
2 users (show)

See Also:
Acceptance Criteria:


Attachments

Description Karl Mikaelsson cendio 2016-08-01 16:25:48 CEST
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 Karl Mikaelsson cendio 2016-08-01 16:28:30 CEST
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 Karl Mikaelsson cendio 2016-08-01 17:10:32 CEST
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 Karl Mikaelsson cendio 2016-08-01 17:35:32 CEST
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 Karl Mikaelsson cendio 2016-08-09 13:32:58 CEST
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 Samuel Mannehed cendio 2016-08-10 11:03:42 CEST
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.

Note You need to log in before you can comment on or make changes to this bug.