From 067d7642bc8e135f9c9f516353fbf46d25ae6e48 Mon Sep 17 00:00:00 2001 From: Tasos Papaioannou Date: Wed, 2 Oct 2024 12:50:58 -0400 Subject: [PATCH] Remove CSV parser workaround --- robottelo/cli/hammer.py | 10 +--------- robottelo/cli/repository.py | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/robottelo/cli/hammer.py b/robottelo/cli/hammer.py index d0ba7e845ea..e04db414cee 100644 --- a/robottelo/cli/hammer.py +++ b/robottelo/cli/hammer.py @@ -4,7 +4,7 @@ import json import re -from robottelo.config import logger +from robottelo.logging import logger def _normalize(header): @@ -39,14 +39,6 @@ def _normalize_obj(obj): def parse_csv(output): """Parse CSV output from Hammer CLI and return a Python dictionary.""" - - # https://projects.theforeman.org/issues/37264 - NON_CSV_PATTERN = r'\d+ task\(s\), \d+ success, \d+ fail' - - output, num_changes = re.subn(NON_CSV_PATTERN, '', output) - if num_changes > 0: - logger.warning(f'Removed output from CLI based on regex: {NON_CSV_PATTERN!s}') - output = output.splitlines() # Normalize the column names to use when generating the dictionary diff --git a/robottelo/cli/repository.py b/robottelo/cli/repository.py index a17cc9fbcba..98289610d89 100644 --- a/robottelo/cli/repository.py +++ b/robottelo/cli/repository.py @@ -61,7 +61,7 @@ def synchronize(cls, options, return_raw_response=None, timeout=3600000): cls.command_sub = 'synchronize' return cls.execute( cls._construct_command(options), - output_format='base', + output_format='csv', ignore_stderr=True, return_raw_response=return_raw_response, timeout=timeout,