bootstrap-ansible script fails at sed CURRENT_OSA_VERSION

Bug #1997365 reported by George Shuklin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Undecided
Unassigned

Bug Description

Something broken after last Friday (18.11.2022). boostrap-ansible.sh worked, now it's fails at following:

+ sed -i 's|OSA_ANSIBLE_FORKS|10|g' /usr/local/bin/openstack-ansible.rc
+ cp -v scripts/openstack-ansible.sh /usr/local/bin/openstack-ansible
'scripts/openstack-ansible.sh' -> '/usr/local/bin/openstack-ansible'
+ sed -i 's|OSA_CLONE_DIR|/opt/openstack-ansible|g' /usr/local/bin/openstack-ansible
+ sed -i 's|CURRENT_OSA_VERSION|[pbr] Generating ChangeLog
25.2.0|g' /usr/local/bin/openstack-ansible
sed: -e expression #1, char 48: unterminated `s' command
++ exit_fail 375 0
++ set +x

I believe this happens because setup.py reports version with additional string:

/opt/ansible-runtime/bin/python setup.py --version 2>/dev/null
[pbr] Generating ChangeLog
25.2.0

The line `[pbr] Generating ChangeLog` does not look like a proper CURRENT_OSA_VERSION for me.

Versions checked:

25.0.0
25.2.0

Host OS: Debian 11.5

Revision history for this message
George Shuklin (george-shuklin) wrote :

Update: there is no problem on Ubuntu 20.04, setup.py --version report only version without string '[pbr] Generating ChangeLog'.

Revision history for this message
George Shuklin (george-shuklin) wrote (last edit ):

I have suspicion that the problem is around python 3.9. There is a new release of setuptools, version 65.6.0 (released 19.11.2022), which subtly changed output behavior for setup.py execution.

Revision history for this message
Dmitriy Rabotyagov (noonedeadpunk) wrote :

Oh, you're right about setuptools. We used to fix setuptools version in prior releases, but dropped that since setuptools appeared in upper-constraints.
And I think we totally missed that in Yoga and Zed it's dropped out of u-c, or well, it's constrained only for specific python versions:
https://opendev.org/openstack/requirements/src/branch/stable/yoga/upper-constraints.txt#L643-L644

Quite easy to fix though, despite it's a bit annoying thing.

Revision history for this message
George Shuklin (george-shuklin) wrote :

I suspect that it was aggravated because there is no constrains for python3.9 (which is the default python for Debian Bullseye), and a very new version of setuptools is installed. Ubuntu is not affected, because there is python3.8 and there is constrain on setuptools version for it for python3.9.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible (master)
Changed in openstack-ansible:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible (stable/yoga)

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/openstack-ansible/+/865160

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible (master)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible (stable/yoga)

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/openstack-ansible/+/865166

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on openstack-ansible (master)

Change abandoned by "Dmitriy Rabotyagov <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/openstack-ansible/+/865297

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on openstack-ansible (stable/yoga)

Change abandoned by "Dmitriy Rabotyagov <email address hidden>" on branch: stable/yoga
Review: https://review.opendev.org/c/openstack/openstack-ansible/+/865160

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible (master)

Reviewed: https://review.opendev.org/c/openstack/openstack-ansible/+/865312
Committed: https://opendev.org/openstack/openstack-ansible/commit/7eebc69e8a5a2a6346f68b11bd9f6b6109e10fd9
Submitter: "Zuul (22348)"
Branch: master

commit 7eebc69e8a5a2a6346f68b11bd9f6b6109e10fd9
Author: Dmitriy Rabotyagov <email address hidden>
Date: Tue Nov 22 18:10:01 2022 +0100

    Update self version fetching mechanism

    With release of new setuptools running setup.py --version started
    returining extra line. Eventually, running setup.py as a script is not
    considered as good practice and we should not rely on it's output much.
    Instead, we can leverage importlib.metadata as it should be more
    reliable in long run.

    Closes-Bug: #1997365
    Change-Id: Ife227db4ad25851456e1acc6b4daf198f39d989a

Changed in openstack-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/openstack-ansible/+/865166
Committed: https://opendev.org/openstack/openstack-ansible/commit/f933194813de9d18b89040fa8c5b80bcd0dd967c
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit f933194813de9d18b89040fa8c5b80bcd0dd967c
Author: Dmitriy Rabotyagov <email address hidden>
Date: Tue Nov 22 18:10:01 2022 +0100

    Update self version fetching mechanism

    With release of new setuptools running setup.py --version started
    returining extra line. Eventually, running setup.py as a script is not
    considered as good practice and we should not rely on it's output much.
    Instead, we can leverage importlib.metadata as it should be more
    reliable in long run.

    Closes-Bug: #1997365
    Change-Id: Ife227db4ad25851456e1acc6b4daf198f39d989a

tags: added: in-stable-yoga
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible 26.0.0.0rc1

This issue was fixed in the openstack/openstack-ansible 26.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible 25.3.0

This issue was fixed in the openstack/openstack-ansible 25.3.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.