Bug 1509665
| Summary: | installing older version images (yum localinstall) create wrong latest links in rhosp-director-images [openstack-12] | |||
|---|---|---|---|---|
| Product: | Red Hat OpenStack | Reporter: | Raviv Bar-Tal <rbartal> | |
| Component: | rhosp-director-images | Assignee: | Mike Burns <mburns> | |
| Status: | CLOSED ERRATA | QA Contact: | Raviv Bar-Tal <rbartal> | |
| Severity: | medium | Docs Contact: | ||
| Priority: | medium | |||
| Version: | 12.0 (Pike) | CC: | dbecker, jslagle, mbracho, mburns, mlopes, morazi, rhel-osp-director-maint, sclewis | |
| Target Milestone: | ga | Keywords: | Reopened, Triaged | |
| Target Release: | 12.0 (Pike) | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | rhosp-director-images-12.0-20171116.2.el7ost | Doc Type: | Bug Fix | |
| Doc Text: |
Prior to this update, a logic error in the %post scriptlet resulted in the installation of images from an older major release; this arose after a later release incorrectly set the version-specific symlink.
With this update, the script was updated to correctly handle versions, and the symlinks are created correctly.
|
Story Points: | --- | |
| Clone Of: | ||||
| : | 1514544 1514545 1514546 1514547 (view as bug list) | Environment: | ||
| Last Closed: | 2017-12-13 20:03:43 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
Raviv Bar-Tal
2017-11-05 14:18:13 UTC
This is exactly how it's supposed to work. -latest is always supposed to point to the "newest" version on the system. If an older version is desired, you must point to the version specific image file rather that the -latest symlink. I disagree, the latest link also include the version number, In the case above the symlink: /usr/share/rhosp-director-images/ironic-python-agent-latest-10.0.tar * Latest 10 release image Points to: /usr/share/rhosp-director-images/ironic-python-agent-12.0-20171102.3.el7ost.tar ** latest 12 release image I would agree in case the *latest* symlink did not include version number Raviv Reopening to investigate Installing OSP 12 images, then OSP 10 images produces this: overcloud-full-latest-10.0.tar -> /usr/share/rhosp-director-images/overcloud-full-12.0-20171116.1.el7ost.tar ironic-python-agent-latest-10.0.tar -> /usr/share/rhosp-director-images/ironic-python-agent-12.0-20171116.1.el7ost.tar Installing in the opposite direction, 10 first, then 12: ironic-python-agent-latest-10.0.tar -> /usr/share/rhosp-director-images/ironic-python-agent-10.0-20171108.1.el7ost.tar overcloud-full-latest-10.0.tar -> /usr/share/rhosp-director-images/overcloud-full-10.0-20171108.1.el7ost.tar So it's only the install of an older version that breaks this I think I've found the culprit. In the %post script:
ver_major=${version%.*}
ver_major is used to check whether a particular version.txt file is for the same major release as the rpm being installed. In the spec file, ${version} is not defined, only %{version} is. In spec, you also cannot do the %.* variable parsing, so the spec needs to add this in the %post script prior to the ver+major= line
version=%{version}
Then things work correctly.
This needs to be done on every OSP version starting with OSP 8.
This is the specfile change:
diff --git a/rhosp-director-images.spec b/rhosp-director-images.spec
index ee5401a..5b37081 100644
--- a/rhosp-director-images.spec
+++ b/rhosp-director-images.spec
@@ -55,6 +55,7 @@ echo %{version},%{release} > %{buildroot}%{app_root}/version-%{version}-%{releas
%post
nvr=0
nv=0
+version=%{version}
ver_major=${version%.*}
for ver in %{app_root}/version-*txt; do
ver=$(basename $(echo $ver | sed 's/\.txt//'))
Note for testing: This only shows up when you install images from an older release *after* a newer release. IOW, without the fix: Install OSP 12 images, then OSP 10 images --> failure Install OSP 10 images, then OSP 12 images --> works This bug is actually fixed for osp13 and above. This means that when trying to install osp12 images on osp13 undercloud, The symlinks will be correct and each latest-version link will point to the correct image. 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/RHEA-2017:3459 |