Bug 2283506 - regex_escape blocks OS::TripleO::Services::NovaLibvirtLegacy deployment
Summary: regex_escape blocks OS::TripleO::Services::NovaLibvirtLegacy deployment
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-heat-templates
Version: 17.1 (Wallaby)
Hardware: All
OS: All
medium
medium
Target Milestone: z4
: 17.1
Assignee: Bogdan Dobrelya
QA Contact: Joe H. Rahme
URL:
Whiteboard:
: 2295411 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-05-27 14:04 UTC by Alex Stupnikov
Modified: 2024-11-21 09:31 UTC (History)
7 users (show)

Fixed In Version: openstack-tripleo-heat-templates-14.3.1-17.1.20240919130751.e7c7ce3.el9ost openstack-tripleo-heat-templates-14.3.1-17.1.20240826193747.e7c7ce3.el8ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-11-21 09:31:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker OSP-32163 0 None None None 2024-05-27 14:08:36 UTC
Red Hat Product Errata RHBA-2024:9973 0 None None None 2024-11-21 09:31:24 UTC

Description Alex Stupnikov 2024-05-27 14:04:39 UTC
Description of problem:

Command [1] is blocked by error [2] in customer's lab. It looks like this problem is coming from the following play defined in deployment/deprecated/nova/nova-libvirt-container-puppet.yaml:

- name: Switch running image to new image in wrapper script
  shell: |
    sed -i -e 's/{{ old_virtlogd_image.stdout | regex_escape() }}/{{ virtlogd_image | regex_escape() }}/' /var/lib/container-config-scripts/virtlogd_wrapper
  when: old_virtlogd_image.stdout != virtlogd_image

It looks like regex_escape() plugin doesn't escape slashes properly. It may make sense to switch to syntax that is already used in deployment/nova/nova-modular-libvirt-container-puppet.yaml for the same task.

Problem is reproducible using ansible's debug (dots and hyphens are escaped, but not slashes):

  - name: print outcome
    debug: msg="{{ old_virtlogd_image | regex_escape() }}"

TASK [print outcome] ******************************************************************************************************************************************************
ok: [127.0.0.1] => {
    "msg": "registry\\.redhat\\.io/rhosp\\-rhel8/openstack\\-nova\\-libvirt:17\\.1\\.2"
}

[1]
openstack overcloud upgrade run --yes --stack overcloud --tags system_upgrade --limit ControllerLeaf0,ObjectStorageLeaf0,NetworkerLeaf0

[2]
FATAL | Switch running image to new image in wrapper script | compute01 | error={"changed": true, "cmd": "sed -i -e 's/registry\\.redhat\\.io/rhosp\\-rhel8/openstack\\-nova\\-libvirt:17\\.1\\.2/director\\-test3\\.ctlplane\\.sdc\\.subdomain\\.example\\.com:8787/rhosp\\-rhel9/openstack\\-nova\\-libvirt:17\\.1/' /var/lib/container-config-scripts/virtlogd_wrapper\n", "delta": "0:00:00.004390", "end": "2024-05-21 15:03:27.345631", "msg": "non-zero return code", "rc": 1, "start": "2024-05-21 15:03:27.341241", "stderr": "sed: -e expression #1, char 37: unknown option to `s'", "stderr_lines": ["sed: -e expression #1, char 37: unknown option to `s'"], "stdout": "", "stdout_lines": []}


Version-Release number of selected component (if applicable):
RHOSP 17.1.2

How reproducible:
Run "openstack overcloud upgrade run --yes --stack overcloud --tags system_upgrade ..." command while using NovaLibvirtLegacy service.


Actual results:
Operation fails because regex_escape() fails to process URL properly and make it usable for sed.

Expected results:
sed command is able to replace URLs properly

Comment 3 Lukas Bezdicka 2024-07-17 13:40:36 UTC
*** Bug 2295411 has been marked as a duplicate of this bug. ***

Comment 13 errata-xmlrpc 2024-11-21 09:31:22 UTC
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 (RHOSP 17.1.4 bug fix and enhancement 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-2024:9973


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