[checks] Reduce code duplication

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2016-03-10 12:35:08 +01:00
parent 0f3bfbbddf
commit 19468dda77
1 changed files with 6 additions and 4 deletions

View File

@ -19,6 +19,10 @@ import os.path
import platform
def _will_productimg_run(conf):
return conf.get('productimg', False) and conf.get('bootable', False)
def is_jigdo_needed(conf):
return conf.get('create_jigdo', True)
@ -30,8 +34,7 @@ def is_isohybrid_needed(conf):
x86_64 and i386.
"""
runroot = conf.get('runroot', False)
will_do_productimg = conf.get('productimg', False) and conf.get('bootable', False)
if runroot and not will_do_productimg:
if runroot and not _will_productimg_run(conf):
return False
if platform.machine() not in ('x86_64', 'i386'):
msg = ('Not checking for /usr/bin/isohybrid due to current architecture. '
@ -45,8 +48,7 @@ def is_genisoimage_needed(conf):
"""This is only needed locally for productimg and createiso without runroot.
"""
runroot = conf.get('runroot', False)
will_do_productimg = conf.get('productimg', False) and conf.get('bootable', False)
if runroot and not will_do_productimg:
if runroot and not _will_productimg_run(conf):
return False
return True