Re: [PATCH] rteval: osinfo.py: Added code to use 'sos report' instead of sosreport.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Tue, 13 Jun 2023, Anubhav Shelat wrote:

> sosreport is deprecated, so if available on the system osinfo will try
> to use the sos command instead.
> 
> Signed-off-by: Anubhav Shelat <ashelat@xxxxxxxxxx>
> ---
>  rteval/sysinfo/osinfo.py | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/rteval/sysinfo/osinfo.py b/rteval/sysinfo/osinfo.py
> index 83dc78b96fdd..0c570c0e395b 100644
> --- a/rteval/sysinfo/osinfo.py
> +++ b/rteval/sysinfo/osinfo.py
> @@ -62,12 +62,14 @@ class OSInfo:
>  
>  
>      def run_sysreport(self, repdir):
> -        if os.path.exists('/usr/sbin/sosreport'):
> +        if os.path.exists('/usr/sbin/sos'):
> +            exe = '/usr/sbin/sos report'
> +        elif os.path.exists('/usr/sbin/sosreport'):
>              exe = '/usr/sbin/sosreport'
>          elif os.path.exists('/usr/sbin/sysreport'):
>              exe = '/usr/sbin/sysreport'
>          else:
> -            raise RuntimeError("Can't find sosreport/sysreport")
> +            raise RuntimeError("Can't find sos/sosreport/sysreport")
>  
>          self.__logger.log(Log.DEBUG, f"report tool: {exe}")
>          options = ['-k', 'rpm.rpmva=off',
> @@ -75,8 +77,8 @@ class OSInfo:
>                     '--batch']
>  
>          self.__logger.log(Log.INFO, "Generating SOS report")
> -        self.__logger.log(Log.INFO, f"using command {' '.join([exe]+options)}")
> -        subprocess.call([exe] + options)
> +        self.__logger.log(Log.INFO, f"using command {' '.join(exe.split()+options)}")
> +        subprocess.call(exe.split() + options)
>          for s in glob('/tmp/s?sreport-rteval-*'):
>              self.__logger.log(Log.DEBUG, f"moving {s} to {repdir}")
>              shutil.move(s, repdir)
> -- 
> 2.31.1
> 
> 
Signed-off-by: John Kacur <jkacur@xxxxxxxxxx>




[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux