From: "Li, Xiaoyun" <xiaoyun.li@intel.com>
To: "Xing, Beilei" <beilei.xing@intel.com>,
"stable@dpdk.org" <stable@dpdk.org>
Cc: "yongxin.liu@windriver.com" <yongxin.liu@windriver.com>,
"Richardson, Bruce" <bruce.richardson@intel.com>,
"Yigit, Ferruh" <ferruh.yigit@intel.com>,
"Xing, Beilei" <beilei.xing@intel.com>
Subject: Re: [dpdk-stable] [PATCH] usertools: fix Python compatibility issue
Date: Thu, 11 Mar 2021 06:53:31 +0000 [thread overview]
Message-ID: <CY4PR11MB175005E5D287A4ED5EBA81D499909@CY4PR11MB1750.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210304030736.69702-1-beilei.xing@intel.com>
> -----Original Message-----
> From: stable <stable-bounces@dpdk.org> On Behalf Of beilei.xing@intel.com
> Sent: Thursday, March 4, 2021 11:08
> To: stable@dpdk.org
> Cc: yongxin.liu@windriver.com; Richardson, Bruce
> <bruce.richardson@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>; Xing,
> Beilei <beilei.xing@intel.com>
> Subject: [dpdk-stable] [PATCH] usertools: fix Python compatibility issue
>
> From: Beilei Xing <beilei.xing@intel.com>
>
> For LTS release before 20.02 which should support both Python 2 and 3, when
> running usertools/dpdk-devbind.py with Python 2,there'll be the following error:
>
> Traceback (most recent call last):
> File "usertools/dpdk-devbind.py", line 755, in <module>
> main()
> File "usertools/dpdk-devbind.py", line 743, in main
> check_modules()
> File "usertools/dpdk-devbind.py", line 198, in check_modules
> if module_is_loaded(mod["Name"]):
> File "usertools/dpdk-devbind.py", line 177, in module_is_loaded
> release = platform.uname().release
> AttributeError: 'tuple' object has no attribute 'release'
>
> The root cause is that Python 2 doesn't support platform.uname().release, which
> is supported by Python 3.
>
> Fixes: 1e794e710d18 ("usertools: fix binding built-in kernel driver")
> Cc: stable@dpdk.org
>
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> ---
> usertools/dpdk-devbind.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py index
> 262a5ff3a9..44ea3dd30b 100755
> --- a/usertools/dpdk-devbind.py
> +++ b/usertools/dpdk-devbind.py
> @@ -174,7 +174,7 @@ def module_is_loaded(module):
> loaded_modules = sysfs_mods
>
> # add built-in modules as loaded
> - release = platform.uname().release
> + release = platform.release()
> filename = os.path.join("/lib/modules/", release, "modules.builtin")
> if os.path.exists(filename):
> try:
> --
> 2.26.2
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
prev parent reply other threads:[~2021-03-11 6:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-04 3:07 beilei.xing
2021-03-11 6:53 ` Li, Xiaoyun [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=CY4PR11MB175005E5D287A4ED5EBA81D499909@CY4PR11MB1750.namprd11.prod.outlook.com \
--to=xiaoyun.li@intel.com \
--cc=beilei.xing@intel.com \
--cc=bruce.richardson@intel.com \
--cc=ferruh.yigit@intel.com \
--cc=stable@dpdk.org \
--cc=yongxin.liu@windriver.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;
as well as URLs for NNTP newsgroup(s).