Re: [PATCH 1/3] rteval: Only process warnings if dmidecode_loaded is True

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

 



John Kacur <jkacur@xxxxxxxxxx> writes:

> If python-dmidecode is not available, then you can't test hasattr
> or you will get a NameError. Simply return instead.
>
> Signed-off-by: John Kacur <jkacur@xxxxxxxxxx>
> ---
>  rteval/sysinfo/dmi.py | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/rteval/sysinfo/dmi.py b/rteval/sysinfo/dmi.py
> index bd397360096a..80cf3c723b36 100644
> --- a/rteval/sysinfo/dmi.py
> +++ b/rteval/sysinfo/dmi.py
> @@ -42,6 +42,9 @@ except ModuleNotFoundError:
>  def ProcessWarnings():
>      """ Process Warnings from dmidecode """
>  
> +    if not dmidecode_loaded:
> +        return
> +
>      if not hasattr(dmidecode, 'get_warnings'):
>          return

Tested after purging python3-dmidecode package on Debian.

Tested-by: Punit Agrawal <punit1.agrawal@xxxxxxxxxxxxx>

Thanks,
Punit



[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