Skip to content

Commit

Permalink
Merge pull request htcondor#61 from JaimeFrey/HTCONDOR-549-python2-co…
Browse files Browse the repository at this point in the history
…mpat

Use Python 2 on EL7 HTCONDOR-549
  • Loading branch information
JaimeFrey authored Aug 2, 2021
2 parents bef1de5 + 621debc commit 1adbfd0
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
8 changes: 8 additions & 0 deletions rpm/blahp.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
%define bl_libexecdir %{_libexecdir}/%{name}

# Force brp-python-bytecompile to use Python 3
%if ! 0%{?rhel} == 7
%global __python /usr/bin/python3
%endif

Name: blahp
Version: 2.1.0
Expand All @@ -31,7 +33,9 @@ BuildRequires: globus-gsi-proxy-core-devel
BuildRequires: globus-gsi-cert-utils-devel
BuildRequires: docbook-style-xsl, libxslt

%if ! 0%{?rhel} == 7
Requires: python3
%endif

%description
%{summary}
Expand All @@ -40,6 +44,10 @@ Requires: python3
%setup

%build
%if 0%{?rhel} == 7
# Don't rely on Python 3 on EL7 (not installed by default)
sed -i 's;/usr/bin/python3;/usr/bin/python2;' src/scripts/*status.py
%endif
./bootstrap
export CPPFLAGS="-I/usr/include/classad -std=c++11 -fcommon"
export LDFLAGS="-lclassad -lglobus_gsi_credential -lglobus_common -lglobus_gsi_proxy_core"
Expand Down
8 changes: 6 additions & 2 deletions src/scripts/blah.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
"""Common functions for BLAH python scripts"""

from configparser import RawConfigParser
from io import StringIO
try: # for Python 2
from ConfigParser import RawConfigParser
from StringIO import StringIO
except ImportError: # for Python 3
from configparser import RawConfigParser
from io import StringIO

class BlahConfigParser(RawConfigParser, object):

Expand Down
2 changes: 2 additions & 0 deletions src/scripts/lsf_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
for subsequent queries.
"""

from __future__ import print_function

import os
import re
import pwd
Expand Down
2 changes: 2 additions & 0 deletions src/scripts/pbs_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
for subsequent queries.
"""

from __future__ import print_function

import os
import re
import pwd
Expand Down
2 changes: 2 additions & 0 deletions src/scripts/slurm_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
will reuse this for subsequent queries.
"""

from __future__ import print_function

import os
import re
import pwd
Expand Down

0 comments on commit 1adbfd0

Please sign in to comment.