From 55cd4d207f36afd8532fca570e6673e13b107a7c Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Mon, 18 Nov 2013 17:09:00 -0800 Subject: [PATCH] livemedia-creator: Cleanup temp yum files (#1073502) When running lmc with --no-virt yum will use /tmp/ to cache some things. If the kickstart or repos change between runs this cache can become stale so remove it when lmc is finished. Resolves: 1073502 --- src/sbin/livemedia-creator | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sbin/livemedia-creator b/src/sbin/livemedia-creator index a84f6119..42b63ba4 100755 --- a/src/sbin/livemedia-creator +++ b/src/sbin/livemedia-creator @@ -559,6 +559,11 @@ def novirt_install(opts, disk_img, disk_size, repo_url): selinux_enforcing = True selinux.security_setenforce(0) + # Clean up /tmp/ from previous runs to prevent stale info from being used + for path in ["/tmp/yum.repos.d/", "/tmp/yum.cache/"]: + if os.path.isdir(path): + shutil.rmtree(path) + args = ["--kickstart", opts.ks[0], "--cmdline", "--repo", repo_url] if opts.anaconda_args: for arg in opts.anaconda_args: