Skip to content

Commit

Permalink
fix: do not print collection messages for compliance apiv2 options
Browse files Browse the repository at this point in the history
- RHINENG-14959
- When any compliance apiv2 options is specified nothing will be
  collected, hence data collection relevant messages should not be
  printed to console.
  The rm_conf which includes the file/content redaction is also
  cleared for compliance apiv2 for this reason.

Signed-off-by: Xiangce Liu <[email protected]>
  • Loading branch information
xiangce committed Dec 20, 2024
1 parent 644d314 commit ab8457f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions insights/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,15 @@ def collect(config):
pc = InsightsUploadConf(config)
dc = CoreCollector(config)

logger.info('Starting to collect Insights data for %s' % determine_hostname(config.display_name))

dc.run_collection(pc.get_rm_conf(),
get_branch_info(config),
pc.create_report())
rm_conf = {}
# Do not print collection relevant messages for compliance apiv2 options
if not (config.compliance_policies or config.compliance_assign or config.compliance_unassign):
rm_conf = pc.get_rm_conf()
logger.info(
'Starting to collect Insights data for %s' % determine_hostname(config.display_name)
)

dc.run_collection(rm_conf, get_branch_info(config), pc.create_report())

return dc.done()

Expand Down

0 comments on commit ab8457f

Please sign in to comment.