ocs_ci.ocs.must_gather package

Submodules

ocs_ci.ocs.must_gather.const_must_gather module

The Procedure to add new version: 1.New Version created 2.Add the new version to GATHER_COMMANDS_VERSION dictionary 3.Ask the developer about new files on new version 4.Add file names to relevant list

OCS4.6 Link: https://github.com/openshift/ocs-operator/blob/fefc8a0e04e314801809df2e5292a20fae8456b8/must-gather/collection-scripts/

OCS4.5 Link: https://github.com/openshift/ocs-operator/blob/de48c9c00f8964f0f8813d7b3ddd25f7bc318449/must-gather/collection-scripts/

OCS 4.20 Notes:

  • Significant structural changes: files now organized by API group in subdirectories (e.g., apps/, core/, noobaa/, ceph/)

  • The existing os.walk() validation logic handles the new structure automatically

  • Added 33 new CEPH commands (see GATHER_COMMANDS_CEPH_4_20)

  • Added 12 new JSON commands (see GATHER_COMMANDS_JSON_4_20)

  • Deprecated commands removed via GATHER_COMMANDS_JSON_4_20_EXCLUDE: * ceph_osd_blacklist_ls replaced by ceph_osd_blocklist_ls (terminology change) * ceph_balancer_pool_ls no longer collected * ceph_progress_json replaced by formatted version

  • Old NooBaa PostgreSQL files excluded via GATHER_COMMANDS_OTHERS_EXCLUDE_4_20 (NooBaa migrated to CNPG in 4.20)

ocs_ci.ocs.must_gather.must_gather module

class ocs_ci.ocs.must_gather.must_gather.MustGather

Bases: object

MustGather Class

check_pod_name_pattern(pod_name)

check Pod Name Pattern

Parameters:

pod_name (str) – pod name

Returns:

True if match pattern, False otherwise

Return type:

bool

cleanup()

Delete temporary folder.

collect_must_gather(ocs_flags=None, mg_options=None)

Collect ocs_must_gather and copy the logs to a temporary folder.

Parameters:
  • ocs_flags (str) – ocs flags to must gather command for example [”– /usr/bin/gather -cs”]

  • mg_options (str) – Options of must gather command For example “–host_network=True”

compare_running_pods()

Compare running pods list to “/pods” subdirectories

get_all_paths()

Get all paths in must gather dir (directory and/or tar.gz archives).

When REPORTING[“tarball_mg_logs”] is used, must-gather may be packed into a .tar.gz; this method collects paths from both directory trees and from inside such tarballs.

property log_type
print_invalid_files()

Print Invalid Files

print_must_gather_debug() None
search_file_path()

Search File Path

In post-upgrade scenarios, uses config.UPGRADE[“upgrade_ocs_version”] to ensure correct version-specific file expectations.

validate_expected_files()

Make sure all the relevant files exist

validate_file_size()

Validate the file is not empty

validate_must_gather()

Validate must-gather

verify_ceph_file_content()

Verify ceph command does not return an error https://bugzilla.redhat.com/show_bug.cgi?id=2014849 https://bugzilla.redhat.com/show_bug.cgi?id=2021427

verify_noobaa_diagnostics()

Verify noobaa diagnostics folder exist

verify_paths_in_dir(paths)

Verify paths exist in must gather directory

Parameters:

paths (list) – list of paths in mg directory for example /ceph_logs/journal_ exist in /mg_dir/a/b/ceph/ceph_logs/journal_compute-1/log.log

Returns:

the paths do not exist in mg dir

Return type:

list

verify_paths_not_in_dir(paths)

Verify paths do not exist in must gather directory

Parameters:

paths (list) – list of paths in mg directory for example /ceph_logs/journal_ exist in /mg_dir/a/b/ceph/ceph_logs/journal_compute-1/log.log

Returns:

the paths exist in mg dir

Return type:

list

Module contents