Bug 1671721
Summary: | python3 incompatible expression fails deploy during restart ceph osds daemon(s) - container | ||
---|---|---|---|
Product: | [Red Hat Storage] Red Hat Ceph Storage | Reporter: | John Fulton <johfulto> |
Component: | Ceph-Ansible | Assignee: | John Fulton <johfulto> |
Status: | CLOSED ERRATA | QA Contact: | Ameena Suhani S H <amsyedha> |
Severity: | high | Docs Contact: | |
Priority: | low | ||
Version: | 4.0 | CC: | amsyedha, anharris, aschoen, ceph-eng-bugs, ceph-qe-bugs, gmeno, nthomas, tchandra, tserlin |
Target Milestone: | rc | ||
Target Release: | 4.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | ceph-ansible-4.0.0beta1 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-01-31 12:45:38 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
John Fulton
2019-02-01 12:50:25 UTC
Root cause seems to be here: https://github.com/ceph/ceph-ansible/blob/master/roles/ceph-handler/templates/restart_osd_daemon.sh.j2#L12 I reproduced the error using the generated shell command with python3. If I use python2 then the reported syntax error goes away. [root@rhel8 ~]# export PYTHON=python3; $(podman exec d9307c880ce8 ceph --name client.bootstrap-osd --keyring /var/lib/ceph/bootstrap-osd/ceph.keyring --cluster ceph -s -f json | $PYTHON -c 'import sys, json; print(json.load(sys.stdin)[pgmap][num_pgs])') -eq $(podman exec d9307c880ce8 ceph --name client.bootstrap-osd --keyring /var/lib/ceph/bootstrap-osd/ceph.keyring --cluster ceph -s -f json | $PYTHON -c 'import sys, json; print sum ( [ i[count] for i in json.load(sys.stdin)[pgmap][pgs_by_state] if active+clean in i[state_name]])') Traceback (most recent call last): File "<string>", line 1, in <module> NameError: name 'pgmap' is not defined File "<string>", line 1 import sys, json; print sum ( [ i[count] for i in json.load(sys.stdin)[pgmap][pgs_by_state] if active+clean in i[state_name]]) ^ SyntaxError: invalid syntax -bash: -eq: command not found [root@rhel8 ~]# [root@rhel8 ~]# export PYTHON=python2; $(podman exec d9307c880ce8 ceph --name client.bootstrap-osd --keyring /var/lib/ceph/bootstrap-osd/ceph.keyring --cluster ceph -s -f json | $PYTHON -c 'import sys, json; print(json.load(sys.stdin)[pgmap][num_pgs])') -eq $(podman exec d9307c880ce8 ceph --name client.bootstrap-osd --keyring /var/lib/ceph/bootstrap-osd/ceph.keyring --cluster ceph -s -f json | $PYTHON -c 'import sys, json; print sum ( [ i[count] for i in json.load(sys.stdin)[pgmap][pgs_by_state] if active+clean in i[state_name]])') Traceback (most recent call last): File "<string>", line 1, in <module> NameError: name 'pgmap' is not defined Traceback (most recent call last): File "<string>", line 1, in <module> NameError: name 'pgmap' is not defined -bash: -eq: command not found [root@rhel8 ~]# Updating the QA Contact to a Hemant. Hemant will be rerouting them to the appropriate QE Associate. Regards, Giri Updating the QA Contact to a Hemant. Hemant will be rerouting them to the appropriate QE Associate. Regards, Giri Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:0312 |