Remove test configuration and read it from the build directory
This commit is contained in:
parent
7372faa969
commit
de9f5b0456
@ -18,12 +18,12 @@ import logging
|
|||||||
log = logging.getLogger("pylorax")
|
log = logging.getLogger("pylorax")
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import pytoml as toml
|
||||||
import time
|
import time
|
||||||
from pykickstart.version import makeVersion, RHEL7
|
from pykickstart.version import makeVersion, RHEL7
|
||||||
from pykickstart.parser import KickstartParser
|
from pykickstart.parser import KickstartParser
|
||||||
|
|
||||||
from pylorax.base import DataHolder
|
from pylorax.base import DataHolder
|
||||||
from pylorax.imgutils import default_image_name
|
|
||||||
from pylorax.installer import novirt_install
|
from pylorax.installer import novirt_install
|
||||||
from pylorax.sysutils import joinpaths
|
from pylorax.sysutils import joinpaths
|
||||||
|
|
||||||
@ -96,33 +96,18 @@ def make_compose(cfg, results_dir):
|
|||||||
ks.readKickstart(ks_path)
|
ks.readKickstart(ks_path)
|
||||||
repo_url = ks.handler.method.url
|
repo_url = ks.handler.method.url
|
||||||
|
|
||||||
# TODO -- This will change based on the type of image requested
|
# Load the compose configuration
|
||||||
# Configuration to pass to novirt_install
|
cfg_file = joinpaths(results_dir, "config.toml")
|
||||||
install_cfg = DataHolder(
|
if not os.path.exists(cfg_path):
|
||||||
image_name = default_image_name("xz", "root.tar"),
|
raise RuntimeError("Missing config.toml for %s" % results_dir)
|
||||||
compression = "xz",
|
cfg_dict = toml.loads(open(cfg_file, "r").read())
|
||||||
#compress_args = ["-9"],
|
cfg_dict["logfile"] = log_dict
|
||||||
compress_args = [],
|
|
||||||
ks = [ks_path],
|
|
||||||
anaconda_args = "",
|
|
||||||
proxy = "",
|
|
||||||
armplatform = "",
|
|
||||||
|
|
||||||
make_tar = True,
|
install_cfg = DataHolder(**cfg_dict)
|
||||||
make_iso = False,
|
|
||||||
make_fsimage = False,
|
|
||||||
fslabel = "",
|
|
||||||
qcow2 = False,
|
|
||||||
|
|
||||||
project = "Red Hat Enterprise Linux",
|
|
||||||
releasever = "7",
|
|
||||||
|
|
||||||
logfile=log_dir
|
|
||||||
)
|
|
||||||
|
|
||||||
# Some kludges for the 99-copy-logs %post, failure in it will crash the build
|
# Some kludges for the 99-copy-logs %post, failure in it will crash the build
|
||||||
for f in ["/tmp/NOSAVE_INPUT_KS", "/tmp/NOSAVE_LOGS"]:
|
for f in ["/tmp/NOSAVE_INPUT_KS", "/tmp/NOSAVE_LOGS"]:
|
||||||
open(f, "w")
|
open(f, "w")
|
||||||
|
|
||||||
log.info("repo_url = %s, cfg = %s", repo_url, install_cfg)
|
log.debug("repo_url = %s, cfg = %s", repo_url, install_cfg)
|
||||||
novirt_install(install_cfg, joinpaths(results_dir, install_cfg.image_name), None, repo_url)
|
novirt_install(install_cfg, joinpaths(results_dir, install_cfg.image_name), None, repo_url)
|
||||||
|
Loading…
Reference in New Issue
Block a user