Bug 1998292

Summary: ceph-external-cluster-details-exporter.py script does not run under Python 2
Product: [Red Hat Storage] Red Hat OpenShift Data Foundation Reporter: Lars Kellogg-Stedman <lars>
Component: rookAssignee: Travis Nielsen <tnielsen>
Status: CLOSED DUPLICATE QA Contact: Elad <ebenahar>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.8CC: madam, ocs-bugs, odf-bz-bot
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-08-26 19:16:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lars Kellogg-Stedman 2021-08-26 18:44:53 UTC
The `ceph-external-cluster-details-exporter.py` script needs to run under Python2 to support systems that are still running RHEL 7, but it contains Python3 only syntax.  For example, at line 568:

        try:
            output = subprocess.check_output(cmd,
                                             stderr=subprocess.PIPE)
        except subprocess.CalledProcessError as exec:

In Python 2 (2.7.5), `exec` is a reserved word and can't be used like this; the above line results in:

      File "ceph-external-cluster-details-exporter.py", line 578
        except subprocess.CalledProcessError as exec:
                                                   ^
    SyntaxError: invalid syntax

Comment 2 Travis Nielsen 2021-08-26 19:16:21 UTC

*** This bug has been marked as a duplicate of bug 1995718 ***