summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Peck <bpeck@redhat.com>2011-05-05 13:43:16 -0400
committerBill Peck <bpeck@redhat.com>2011-05-05 16:00:15 -0400
commit205c5c161996b522e27b54c92adc178ac56600cf (patch)
tree41ee98ca347efe235a309f4e1031e988d115a8cf
parentddccb493b2944ae97134450eff909341d8ec18c8 (diff)
[RFE] Test program interface to install debuginfobeaker-distribution-beaker-setup-1_1-63
Bug: 572835
-rwxr-xr-xLabController/triggers/sync/post/osversion.trigger78
-rwxr-xr-xTasks/distribution/beaker/setup/runtest.sh1
2 files changed, 32 insertions, 47 deletions
diff --git a/LabController/triggers/sync/post/osversion.trigger b/LabController/triggers/sync/post/osversion.trigger
index 35012fa..1650884 100755
--- a/LabController/triggers/sync/post/osversion.trigger
+++ b/LabController/triggers/sync/post/osversion.trigger
@@ -98,68 +98,54 @@ def update_repos(distro):
return distro
repo_path_re = re.compile(r'(%s.*)/repodata' % paths['path'])
- tree_repos = None
+ tree_repos = []
+ # If rcm is defined we can ask what repos are defined for this tree
if rcm is not None:
distro_path = paths['path']
+ prepos = []
while distro_path != '':
distro_path = '/'.join(distro_path.split('/')[1:])
if not distro_path:
break
- prepos = None
try:
prepos = rcm.tree_repos(distro_path)
break
except xmlrpclib.ResponseError:
pass
- if prepos:
- repos = []
- for prepo in prepos:
- repo = os.path.join(paths['tree_path'],prepos[prepo],"repodata")
- if os.path.exists(repo) and repo_path_re.search(repo):
- repos.append('beaker-%s,%s' % (prepo, repo_path_re.search(repo).group(1)))
- tree_repos = ':'.join(repos)
-
- # Catch Fedora Repos
- repo = os.path.join(paths['tree_path'],"repodata")
- if not tree_repos and os.path.exists(repo):
- if repo_path_re.search(repo):
- tree_repos = repo_path_re.search(repo).group(1)
-
- if not tree_repos:
- # Catch RHEL5 Repos
- try:
- repos = glob.glob(os.path.join(paths['tree_path'],"*/repodata"))
- if repos:
- for i, repo in enumerate(repos):
- if repo_path_re.search(repos[i]):
- repos[i] = repo_path_re.search(repos[i]).group(1)
- except TypeError:
- return distro
- tree_repos = string.join(repos,':')
-
- if not tree_repos:
- # Look for RHEL4/3 Repos
- arch_variant_re = re.compile(r'[^-]+-([^-/]+)/*$')
- if arch_variant_re.search(paths['tree_path']):
- variant = arch_variant_re.search(paths['tree_path']).group(1)
- repo = os.path.join(paths['tree_path'], "../repo-%s/repodata" % variant)
- if os.path.exists(repo):
- if repo_path_re.search(repo):
- tree_repos = repo_path_re.search(repo).group(1)
+ for prepo in prepos:
+ repo = os.path.join(paths['tree_path'],prepos[prepo],"repodata")
+ if os.path.exists(repo) and repo_path_re.search(repo):
+ tree_repos.append('beaker-%s,%s' % (
+ prepo,
+ repo_path_re.search(repo).group(1),
+ )
+ )
+ # rcm is not avaialble, fall back to glob...
+ else:
variant_arch_re = re.compile(r'([^/]+)/([^/]+)/tree$')
if variant_arch_re.search(paths['tree_path']):
variant = variant_arch_re.search(paths['tree_path']).group(1)
- arch = variant_arch_re.search(paths['tree_path']).group(2)
- repo = os.path.join(paths['tree_path'], "../repo-%s-%s/repodata" % (variant,arch))
- if os.path.exists(repo):
- if repo_path_re.search(repo):
- tree_repos = repo_path_re.search(repo).group(1)
+ else:
+ variant = ''
+ tree_repos = ['beaker-%s,%s' %
+ (os.path.basename(os.path.dirname(repo)),
+ repo_path_re.search(repo).group(1),
+ ) for repo in \
+ glob.glob(os.path.join(paths['tree_path'],
+ "*/repodata")
+ ) + \
+ glob.glob(os.path.join(paths['tree_path'],
+ "../repo-*%s*/repodata" % variant)
+ ) + \
+ glob.glob(os.path.join(paths['tree_path'],
+ "../debug*/repodata")
+ )
+ ]
- if not tree_repos:
- return distro
- distro['ks_meta']['tree_repos'] = tree_repos
- cobbler.modify_distro(distro['id'],'ksmeta',distro['ks_meta'],token)
+ if tree_repos:
+ distro['ks_meta']['tree_repos'] = ':'.join(tree_repos)
+ cobbler.modify_distro(distro['id'],'ksmeta',distro['ks_meta'],token)
return distro
def update_comment(distro):
diff --git a/Tasks/distribution/beaker/setup/runtest.sh b/Tasks/distribution/beaker/setup/runtest.sh
index cc6902c..239f52d 100755
--- a/Tasks/distribution/beaker/setup/runtest.sh
+++ b/Tasks/distribution/beaker/setup/runtest.sh
@@ -359,7 +359,6 @@ function LabController()
perl -pi -e "s|^anamon_enabled: 0|anamon_enabled: 1|g" /etc/cobbler/settings
perl -pi -e "s|^anamon_enabled: 0|anamon_enabled: 1|g" /etc/cobbler/settings
perl -pi -e "s|^redhat_management_server: .*|redhat_management_server: \"$SERVER_URL\"|g" /etc/cobbler/settings
- echo "rcm: \"http://rcm-xmlrpc.build.bos.redhat.com/rcm\"" >> /etc/cobbler/settings
#FIXME edit /etc/cobbler/modules.conf
# enable testing auth module
perl -pi -e "s|^module = authn_denyall|module = authn_testing|g" /etc/cobbler/modules.conf