From: Punit Agrawal <punitagrawal@gmail.com>
To: John Kacur <jkacur@redhat.com>
Cc: RT <linux-rt-users@vger.kernel.org>,
Clark Williams <williams@redhat.com>
Subject: Re: [PATCH 1/3] rteval: Only process warnings if dmidecode_loaded is True
Date: Mon, 13 Sep 2021 14:39:30 +0900 [thread overview]
Message-ID: <87pmtd9gq5.fsf@stealth> (raw)
In-Reply-To: <20210909130314.6109-1-jkacur@redhat.com> (John Kacur's message of "Thu, 9 Sep 2021 09:03:12 -0400")
John Kacur <jkacur@redhat.com> 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@redhat.com>
> ---
> 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@toshiba.co.jp>
Thanks,
Punit
prev parent reply other threads:[~2021-09-13 5:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-09 13:03 [PATCH 1/3] rteval: Only process warnings if dmidecode_loaded is True John Kacur
2021-09-09 13:03 ` [PATCH 2/3] rteval: Construct a 'model name' on architectures that don't have one John Kacur
2021-09-09 13:03 ` [PATCH 3/3] rteval: systopology.py: Add support for systems that don't have Numa John Kacur
2021-09-13 6:02 ` Punit Agrawal
2021-09-13 5:39 ` Punit Agrawal [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pmtd9gq5.fsf@stealth \
--to=punitagrawal@gmail.com \
--cc=jkacur@redhat.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=williams@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox