Skip to main content

Create a local cache of openQA job log files

Project description

openQA log local

Library and cli to locally collect and inspect logs from openQA

File will be locally cached on disk, downloaded and read transparently.

Dependency

This package internally depend on openQA-python-client: please refer to documentation about openQA autentication.

Installation

pip install openqa_log_local

To install the package from the source code you can use uv:

uv pip install -e .

Usage

Library

To use the library in your Python project, you first need to import the openQA_log_local class:

from openqa_log_local import openQA_log_local

Then, you can create an instance of the class, providing the openQA host URL:

oll = openQA_log_local(host='http://openqa.opensuse.org')

# Get job details
log_details = oll.get_details(job_id=1234)

# Get a list of log files associated to an openQA job.
# No download any log file yet.
log_list = oll.get_log_list(job_id=1234)
log_txt_list = oll.get_log_list(job_id=4567, name_pattern=r".*\\.txt")

# Get content of a single log file. The file is downloaded to the cache
# if not already available locally.
# All the log file content is returned in `log_data`
log_data = oll.get_log_data(job_id=1234, filename=log_list[3])

# Get absolute path with filename of a single log file from the cache.
# The file is downloaded to the cache if not already available locally.
log_filename = oll.get_log_filename(job_id=1234, filename=log_list[3])

Cache can be configured:

oll = openQA_log_local(
    host='http://openqa.opensuse.org',
    cache_location='/home/user/.openqa_cache',
    max_size=100000,
    time_to_live=3600)

... but also ignored and always refreshed :

oll = openQA_log_local(host='http://openqa.opensuse.org', time_to_live=0)

CLI

The package also provides a command-line interface (CLI) for interacting with openQA logs.

To see INFO and DEBUG messages, you can use the --log-level option:

uv run openqa-log-local --log-level INFO get-log-list --host http://openqaworker15.qa.suse.cz --job-id 353681

This will show messages indicating whether there was a cache hit or miss.

Get Job Details

openqa-log-local get-details --host http://openqa.opensuse.org --job-id 1234

Run via uv if you have used uv to install it

uv run openqa-log-local get-details --host http://openqa.opensuse.org --job-id 1234

Get Log List

openqa-log-local get-log-list --host http://openqa.opensuse.org --job-id 1234

Get Log Data

openqa-log-local get-log-data --host http://openqa.opensuse.org --job-id 1234 --filename autoinst-log.txt

Get Log Filename

openqa-log-local get-log-filename --host http://openqa.opensuse.org --job-id 1234 --filename autoinst-log.txt

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openqa_log_local-0.2.1.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openqa_log_local-0.2.1-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file openqa_log_local-0.2.1.tar.gz.

File metadata

  • Download URL: openqa_log_local-0.2.1.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for openqa_log_local-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e8a369c849683c6c06364fe575af2ab22e0f2bd6d72c1797a5d2b969296ad404
MD5 e3909edbf6f9789377b47beb83300cfc
BLAKE2b-256 80fe21e46876ee29e8651588e5256105c2ac06861a5cf1667c2e2c89a9df9fcd

See more details on using hashes here.

Provenance

The following attestation bundles were made for openqa_log_local-0.2.1.tar.gz:

Publisher: publish.yml on mpagot/openqa_log_local

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openqa_log_local-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for openqa_log_local-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 93459677dcf069bbbab72c5383b3cbd309f247adaee344fcc31e53e92b32de94
MD5 20518da477d99c38f7b7f8b8293f7dae
BLAKE2b-256 de609debfc4cc4f01ec1d1b62f657ba2e32808157becf0e0004f2ed068ec296a

See more details on using hashes here.

Provenance

The following attestation bundles were made for openqa_log_local-0.2.1-py3-none-any.whl:

Publisher: publish.yml on mpagot/openqa_log_local

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page