Bug 1335428
| Summary: | Repo names formed incorrectly causing to skip repo addition | ||
|---|---|---|---|
| Product: | [Red Hat Storage] Red Hat Gluster Storage | Reporter: | Sahina Bose <sabose> |
| Component: | gdeploy | Assignee: | Nandaja Varma <nvarma> |
| Status: | CLOSED ERRATA | QA Contact: | Jonathan Holloway <jholloway> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | rhgs-3.1 | CC: | asrivast, jholloway, nvarma, rcyriac, rhinduja, smohan, surs |
| Target Milestone: | --- | Keywords: | ZStream |
| Target Release: | RHGS 3.1.3 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | gdeploy-2.0-16 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-06-23 05:30: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: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1258386, 1311817 | ||
|
Description
Sahina Bose
2016-05-12 08:39:01 UTC
Tried this with gdeploy-2.0-14 [yum1] action=install gpgcheck=no repos=http://rhsqe-repo.lab.eng.blr.redhat.com/brew/glusterfs-3.7-latest-el7rhgs/,http://jenkins.lab.eng.blr.redhat.com/hc/vdsm/latest/,http://jenkins.lab.eng.blr.redhat.com/hc/vdsm/4.17.28-0.1/,http://download.eng.tlv.redhat.com/rel-eng/repos/rhel-7.2-z-candidate/x86_64/ packages=vdsm,vdsm-gluster,ovirt-hosted-engine-setup,screen,gluster-nagios-addons,xauth update=yes But only 1 repo file created failing the deployment. changed: [10.70.42.203] => (item={'url': 'http://rhsqe-repo.lab.eng.blr.redhat.com/brew/glusterfs-3.7-latest-el7rhgs/', 'name': '_20160517205803'}) changed: [10.70.42.203] => (item={'url': 'http://jenkins.lab.eng.blr.redhat.com/hc/vdsm/latest/', 'name': '_20160517205803'}) changed: [10.70.42.203] => (item={'url': 'http://jenkins.lab.eng.blr.redhat.com/hc/vdsm/4.17.28-0.1/', 'name': '_20160517205803'}) changed: [10.70.42.203] => (item={'url': 'http://download.eng.tlv.redhat.com/rel-eng/repos/rhel-7.2-z-candidate/x86_64/', 'name': '_20160517205803'}) Now we will generate UUID for the repo names, so that we don't conflict and
step on other repos.
The following patch will fix the issue:
diff --git a/gdeployfeatures/yum/yum.py b/gdeployfeatures/yum/yum.py
index af6b5a4..ba5bb5e 100644
--- a/gdeployfeatures/yum/yum.py
+++ b/gdeployfeatures/yum/yum.py
@@ -4,8 +4,8 @@ Add functions corresponding to each of the actions in the json file.
The function should be named as follows <feature name>_<action_name>
"""
from gdeploylib import defaults, Helpers
-from datetime import datetime
-import os
+from uuid import uuid4
+from os.path import realpath, basename
helpers = Helpers()
@@ -14,8 +14,8 @@ def yum_install(section_dict):
repo = section_dict.get('repos')
if repo:
repo = helpers.listify(repo)
- reponame = [os.path.basename(x) for x in repo]
- reponame = [(str(x) + '_' + datetime.now().strftime('%Y%m%d%H%M%S'))
+ reponame = [basename(realpath(x)) for x in repo]
+ reponame = [(str(x) + '_' + uuid4().hex)
for x in reponame]
data = []
for url, name in zip(repo, reponame):
Commit https://github.com/gluster-deploy/gdeploy/commit/df9d61e065efe849c9c3c15f16aadf3fe4ad6fc7 fixes the issue. If I rerun gdeploy on the nodes, it's going to create duplicate repo files? Moving back to assigned as duplicate file names are created on each re-run. Proposed fix is to keep the entire path for the repo name, with / replaced with _
+ reponame = [re.sub(r'http(s*):\/\/', '', x) for x in repo]
+ reponame = [x.replace('/', '_') for x in reponame]
With this change the repos will look like:
jenkins.lab.eng.blr.redhat.com_hc_vdsm_latest.repo
rhsqe-repo.lab.eng.blr.redhat.com_brew_glusterfs-3.7-latest-el7rhgs.repo
Commit: https://github.com/gluster/gdeploy/commit/567f434f6d038fba9cd55560bf5155ecd2b4e1c2 Fixes the issue. Build was made on 19th missed moving to ON_QA. This fix is available as part of gdeploy-2.0-16 Marking this BZ verified. Repo files are now created with individual filenames as described in Comment 8 above, and subsequent runs of gdeploy with the same config no longer create duplicate repo files. 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-2016:1250 |