Merge "Fix the wrong apt-ostree package feed"

This commit is contained in:
Zuul 2024-11-22 20:33:27 +00:00 committed by Gerrit Code Review
commit 961cee6dc5
2 changed files with 10 additions and 4 deletions

View File

@ -8,7 +8,6 @@ import logging
import subprocess import subprocess
from software import constants from software import constants
import software.config as cfg
from software.exceptions import APTOSTreeCommandFail from software.exceptions import APTOSTreeCommandFail
LOG = logging.getLogger('main_logger') LOG = logging.getLogger('main_logger')
@ -107,16 +106,19 @@ def component_remove(pkg_feed_dir, component):
raise APTOSTreeCommandFail(msg) raise APTOSTreeCommandFail(msg)
def run_install(repo_dir, sw_release, packages): def run_install(repo_dir, sw_version, sw_release, packages):
""" """
Run Debian package upgrade. Run Debian package upgrade.
:param repo_dir: the path to the ostree repo :param repo_dir: the path to the ostree repo
:param sw_version: System version (MM.mm)
:param sw_release: Patch release version (MM.mm.pp) :param sw_release: Patch release version (MM.mm.pp)
:param packages: List of Debian packages :param packages: List of Debian packages
""" """
LOG.info("Running apt-ostree install") LOG.info("Running apt-ostree install")
package_feed = "http://controller:8080/updates/debian/rel-%s/ %s %s" \
% (sw_version, constants.DEBIAN_RELEASE, sw_release)
packages = " ".join(packages) packages = " ".join(packages)
try: try:
@ -124,7 +126,7 @@ def run_install(repo_dir, sw_release, packages):
["apt-ostree", "compose", "install", ["apt-ostree", "compose", "install",
"--repo", repo_dir, "--repo", repo_dir,
"--branch", "starlingx", "--branch", "starlingx",
"--feed", cfg.package_feed, "--feed", package_feed,
"--component", sw_release, "--component", sw_release,
packages], packages],
check=True, check=True,

View File

@ -2948,7 +2948,11 @@ class PatchController(PatchService):
latest_commit = all_commits[0] latest_commit = all_commits[0]
# Install debian package through apt-ostree # Install debian package through apt-ostree
try: try:
apt_utils.run_install(feed_repo, deploy_release.sw_release, packages) apt_utils.run_install(
feed_repo,
deploy_release.sw_version,
deploy_release.sw_release,
packages)
except APTOSTreeCommandFail: except APTOSTreeCommandFail:
msg = "Failed to install Debian packages." msg = "Failed to install Debian packages."
LOG.exception(msg) LOG.exception(msg)