From 7404a28c6f343d251cb95afcc78a1a6d8d77c010 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Mon, 9 Mar 2015 09:15:31 -0700 Subject: [PATCH] livemedia-creator: Fix up fake yum object for DNF change pylorax unconditionally calls reset() on the dbo, so provide an empty method to keep it happy. The lmc dbo is minimal because it is only used for creating the iso, not anything related to package installation. --- src/sbin/livemedia-creator | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/sbin/livemedia-creator b/src/sbin/livemedia-creator index 60d9ac94..8f736eb1 100755 --- a/src/sbin/livemedia-creator +++ b/src/sbin/livemedia-creator @@ -308,6 +308,21 @@ class IsoMountpoint(object): return +class FakeDNF(object): + """ + A minimal DNF object suitable for passing to RuntimeBuilder + + lmc uses RuntimeBuilder to run the arch specific iso creation + templates, so the the installroot config value is the important part of + this. Everything else should be a nop. + """ + def __init__(self, conf): + self.conf = conf + + def reset(self): + pass + + class VirtualInstall(object): """ Run virt-install using an iso and a kickstart @@ -550,8 +565,8 @@ def make_runtime(opts, mount_dir, work_dir): """ kernel_arch = get_arch(mount_dir) - # Fake yum object - fake_yum = DataHolder(conf=DataHolder(installroot=mount_dir)) + # Fake dnf object + fake_dbo = FakeDNF(conf=DataHolder(installroot=mount_dir)) # Fake arch with only basearch set arch = ArchData(kernel_arch) # TODO: Need to get release info from someplace... @@ -562,7 +577,7 @@ def make_runtime(opts, mount_dir, work_dir): # symlink mount_dir/images to work_dir/images so we don't run out of space os.makedirs(joinpaths(work_dir, "images")) - rb = RuntimeBuilder(product, arch, fake_yum) + rb = RuntimeBuilder(product, arch, fake_dbo) log.info("Creating runtime") rb.create_runtime(joinpaths(work_dir, RUNTIME), size=None)