Current upstream Beaker breaks when given a RHEL7 os directory using
a ".treeinfo". It probably works fine with a ".composeinfo", which I
know is preferred now, but when attempting to import a released ISO
(such as by end users) only a treeinfo is available for the import.
This temporary hack simply knows about the "Server" and also the
"Server-optional" repos. It doesn't know about all of the variants
and probably needs work (for example, to use the class provided
variant-%s data that you have as in composeinfo parsing), or you
might throw it away entirely. Mostly sending this to flag that
the current treeinfo parsing is broken and doesn't work.
I'm using a version of this hack in production in my Beaker
with RHEL7 based aarch64 composes added using treeinfo.
Signed-off-by: Jon Masters <jcm(a)jonmasters.org>
---
LabController/src/bkr/labcontroller/distro_import.py | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/LabController/src/bkr/labcontroller/distro_import.py b/LabController/src/bkr/labcontroller/distro_import.py
index faad616..6e70c40 100755
--- a/LabController/src/bkr/labcontroller/distro_import.py
+++ b/LabController/src/bkr/labcontroller/distro_import.py
@@ -1473,7 +1473,24 @@ def is_importer_for(cls, url, options=None):
def find_repos(self):
repos = []
- try:
+
+ repo_paths = [('Server',
+ 'variant',
+ '.'),
+ ('Server-optional',
+ 'optional',
+ '../../../Server-optional/%s/os/' % self.tree['arch'])]
+
+ for repo in repo_paths:
+ if url_exists(os.path.join(self.parser.url,repo[2],'repodata')):
+ repos.append(dict(
+ repoid=repo[0],
+ type=repo[1],
+ path=repo[2],
+ )
+ )
+
+ try:
addons = self.parser.get('variant-%s' % self.tree['variant'], 'variants')
addons = addons.split(',')
for addon in addons:
--
2.5.5