Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-22395

presets test failure on sos-4.6.1-1

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Undefined Undefined
    • None
    • rhel-8.9.0.z
    • sos
    • None
    • sst_cee_supportability
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None

      What were you trying to do that didn't work?

      https://beaker-archive.host.prod.eng.bos.redhat.com/beaker-logs/2024/01/88298/8829845/15406826/172279522/taskout.log :

       

      Having own preset, using it raises uncaught exception.

      Please provide the package NVR for which bug is seen:

      sos-4.6.1-1

      How reproducible:

      100%

      Steps to reproduce

      1. /etc/sos/presets.d/sostestpreset with content:        {"sostestpreset":
        Unknown macro: {"desc"}

        }

      2.  sos report --preset sostestpreset --batch

      Expected results

      2. runs flawlessly, uses configs from the preset

      Actual results

      2. fails with:

      Could not initialize 'report': 'SoSReport' object has no attribute 'flog'

       

       

      The fix is kind of:

       

          def set_loggers_verbosity(self, verbosity):
              if verbosity:
                  if getattr(self, 'flog', None):
                      self.flog.setLevel(logging.DEBUG)
                  if getattr(self, 'console', None):
                      if self.opts.verbosity > 1:
                          self.console.setLevel(logging.DEBUG)
                      else:
                          self.console.setLevel(logging.WARNING)
              else:
                  self.console.setLevel(logging.WARNING) 

            rhn-support-pmoravec Pavel Moravec
            rhn-support-pmoravec Pavel Moravec
            Pavel Moravec Pavel Moravec
            Adriana Jurkechova Adriana Jurkechova
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: