Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Improve debugging logging while fetching plugins
Browse files Browse the repository at this point in the history
This commit adds more debugging output while fetching a plugin.
  • Loading branch information
sonicaj committed Jun 25, 2019
1 parent 179bef0 commit c72ed24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions iocage_lib/ioc_create.py
Expand Up @@ -23,6 +23,7 @@
# POSSIBILITY OF SUCH DAMAGE.
"""iocage create module."""
import json
import logging
import os
import pathlib
import re
Expand Down Expand Up @@ -73,6 +74,7 @@ def __init__(self, release, props, num, pkglist=None, plugin=False,
self.callback = callback
self.zfs = libzfs.ZFS(history=True, history_prefix="<iocage>")
self.thickconfig = thickconfig
self.log = logging.getLogger('iocage')

if basejail and not clone_basejail:
# We want these thick to remove any odd dependency chains later
Expand Down Expand Up @@ -843,6 +845,8 @@ def create_install_packages(self, jail_uuid, location,
stderr=su.STDOUT)
pkg_err = pkg_install.returncode

self.log.debug(pkg_install.stdout)

if pkg_err == 0:
break

Expand Down
4 changes: 4 additions & 0 deletions iocage_lib/ioc_plugin.py
Expand Up @@ -27,6 +27,7 @@
import datetime
import distutils.dir_util
import json
import logging
import os
import git
import pathlib
Expand Down Expand Up @@ -74,6 +75,7 @@ def __init__(self, release=None, jail=None, plugin=None, branch=None,
self.callback = callback
self.keep_jail_on_failure = keep_jail_on_failure
self.thickconfig = kwargs.pop('thickconfig', False)
self.log = logging.getLogger('iocage')

if self.branch is None and not self.hardened:
freebsd_version = su.run(['freebsd-version'],
Expand Down Expand Up @@ -199,6 +201,7 @@ def fetch_plugin(self, props, num, accept_license):
_json = f"{self.iocroot}/.plugin_index/{self.plugin}.json" if not \
self.plugin.endswith(".json") else self.plugin
plugins = self.fetch_plugin_index(props, index_only=True)
self.log.debug(f'Plugin json file path: {_json}')

try:
with open(_json, "r") as j:
Expand Down Expand Up @@ -505,6 +508,7 @@ def __fetch_plugin_install_packages__(self, jaildir, conf, pkg_repos,
secure = True if "https://" in conf["packagesite"] else False

for kmod in kmods:
self.log.debug(f'Loading {kmod}')
try:
su.check_call(
["kldload", "-n", kmod], stdout=su.PIPE, stderr=su.PIPE)
Expand Down

0 comments on commit c72ed24

Please sign in to comment.