Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionGary Scarborough
2019-01-29 00:09:33 UTC
Description of problem:
Foreman-Maintain backup should have a flag to set the output to plain text so that it can be redirected to a log. Currently the output is formatted with non text characters. Redirecting it to a file results in a lot of garbage in the file.
Version-Release number of selected component (if applicable):
How reproducible:
Always
Steps to Reproduce:
1. foreman-maintain backup offline -y -s backupfile >> log.txt
2. Check log.txt, see non text characters
3.
Actual results:
Lots of non text characters in the log file
Expected results:
An option for plain text output.
Additional info:
The normal use case for backup is to run from cron and redirect the output to a log file.
Why did Sat6 Engineering has chosen for a script that runs 4+ hours to make output adhoc human users only?
I had a hard time to analyze using the standard linux text file tools the sat6 backups logs because they are huge, unreadable, slow to browse (e.g. scroll up in less)
Based on the existing PR https://github.com/theforeman/foreman_maintain/pull/346 made the quick hack below to disable the spinner and writing duplicate lines to the log.
Tested on Sat6.7.1&6.7.2
--------------
--- /usr/share/gems/gems/foreman_maintain-0.5.4/lib/foreman_maintain/reporter/cli_reporter.rb
+++ /usr/share/gems/gems/foreman_maintain-0.5.4/lib/foreman_maintain/reporter/cli_reporter.rb
@@ -56,14 +56,15 @@
def spin
@mutex.synchronize do
return unless @active
- print_current_line
- @spinner_index = (@spinner_index + 1) % @spinner_chars.size
+# print_current_line
+# @spinner_index = (@spinner_index + 1) % @spinner_chars.size
end
end
def print_current_line
@reporter.clear_line
- line = "#{@spinner_chars[@spinner_index]} #{@current_line}"
+# line = "#{@spinner_chars[@spinner_index]} #{@current_line}"
+ line = @current_line
@reporter.print(line)
end
end
@@ -160,7 +161,7 @@
end
def clear_line
- print "\r" + ' ' * @max_length + "\r"
+ @new_line_next_time = true
end
def assumeyes?
-------------------
Hope this helps to improve the PR.
Peter
Verified on 6.10.0 snap 10 with rubygem-foreman_maintain-0.8.7-1.el7sat.noarch:
foreman-maintain now provides the `--plaintext` option for the backup, restore, health and upgrade subcommands, which omits the spinner and colors from the command output.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Satellite 6.10 Satellite Maintenance Release), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2021:4697