df400002d8
Instead of running a long command line in the runroot (or locally), move all that work into a separate script that will be installed. This means chroot will need to install pungi. Everything should work as it did before. The only exception to this is that there is logic to find lorax templates instead of harcoding the location. This is done using a separate script. Related: #230 Fixes: #231 Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
21 lines
609 B
Python
Executable File
21 lines
609 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
# This needs to work with Python 3 as pylorax only provides the find_templates
|
|
# function in recent builds that are not provided for Python 2.7.
|
|
#
|
|
# This script will print a location of lorax templates. If it fails to import
|
|
# pylorax, or the find_templates function does not exist, the first command
|
|
# line argument will be printed instead.
|
|
|
|
import sys
|
|
|
|
if len(sys.argv) != 2:
|
|
print('Usage: {} FALLBACK'.format(sys.argv[0]), file=sys.stderr)
|
|
sys.exit(1)
|
|
|
|
try:
|
|
import pylorax
|
|
print(pylorax.find_templates())
|
|
except (ImportError, AttributeError):
|
|
print(sys.argv[1])
|