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
This commit is contained in:
Brian C. Lane 2013-11-18 17:09:00 -08:00
parent cd8e565f78
commit 55cd4d207f
1 changed files with 5 additions and 0 deletions

View File

@ -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: