| Summary: | rhts_post snipped for adding Distro repo has bugs | ||
|---|---|---|---|
| Product: | [Retired] Beaker | Reporter: | Prudhvi Tella <prudhvi_tella> |
| Component: | lab controller | Assignee: | Bill Peck <bpeck> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 0.6 | CC: | bpeck, dcallagh, mcsontos, rmancy, stl |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2011-07-14 02:07:19 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Prudhvi Tella
2011-06-29 16:21:53 UTC
I can't break our existing tree_repos so the following patch may work.
diff --git a/LabController/snippets/rhts_post b/LabController/snippets/rhts_post
index c361562..79d5de0 100644
--- a/LabController/snippets/rhts_post
+++ b/LabController/snippets/rhts_post
@@ -57,9 +57,17 @@ popd
#end if
# Add Distro Repos
-#if $getVar('tree_repos','') != ''
+#set $tree_repos = $getVar('tree_repos','')
+#if $tree_repos != ''
+#if $tree_repos.find("http://") != -1
+#set $split = "|"
+#set $base = ""
+#else
+#set $split = ":"
+#set $base = "http://$server/distros""
+#end if
#set $i = 0
-#for $repo in $getVar('tree_repos','').split(':')
+#for $repo in $getVar('tree_repos','').split($split)
#set $i = $i + 1
#if $repo.find(",") != -1
#set (reponame, repourl) = $repo.split(',',1)
@@ -70,7 +78,7 @@ popd
cat << EOF > /etc/yum.repos.d/${reponame}.repo
[$reponame]
name=$reponame
-baseurl=http://$server/distros$repourl
+baseurl=$base$repourl
enabled=1
gpgcheck=0
skip_if_unavailable=1
Posting to for feedback. This has not been tested.
This works for me. there is one small bug here: +#set $base = "http://$server/distros"" double quotes at the end. The above bug caused cobbler to not generate a proper kickstart file. Also, even though kickstart file was not generated, the job kept running instead of failing. Maybe another bug to file? I'll fix the double quote mistake. Thanks for testing it. The job would have failed when the watchdog timed out ( should be 20 minutes I believe). Unless beaker-watchdog was not running of course. I didn't wait for 20 minutes :) pushed to gerrit for review |