diff mbox series

[v2,04/10] rteval: Use f-strings in kernel.py

Message ID 20230601202734.813515-5-ashelat@redhat.com
State Superseded
Headers show
Series Cover Letter | expand

Commit Message

Anubhav Shelat June 1, 2023, 8:27 p.m. UTC
Use f-strings in kernel.py

Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
---
 rteval/sysinfo/kernel.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

John Kacur June 12, 2023, 6:35 p.m. UTC | #1
On Thu, 1 Jun 2023, Anubhav Shelat wrote:

> Use f-strings in kernel.py
> 
> Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
> ---
>  rteval/sysinfo/kernel.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/rteval/sysinfo/kernel.py b/rteval/sysinfo/kernel.py
> index f2e9d72ac2ef..ba5cadda40c5 100644
> --- a/rteval/sysinfo/kernel.py
> +++ b/rteval/sysinfo/kernel.py
> @@ -47,8 +47,8 @@ class KernelInfo:
>          policies = {'DLN': 'deadline', 'FF':'fifo', 'RR':'rrobin', 'TS':'other', '?':'unknown'}
>          ret_kthreads = {}
>          self.__log(Log.DEBUG, "getting kthread status")
> -        cmd = '%s -eocommand,pid,policy,rtprio,comm' % getcmdpath('ps')
> -        self.__log(Log.DEBUG, "cmd: %s" % cmd)
> +        cmd = f"{getcmdpath('ps')} -eocommand,pid,policy,rtprio,comm"
> +        self.__log(Log.DEBUG, f"cmd: {cmd}")
>          c = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
>          for p in c.stdout:
>              v = p.strip().split()
> -- 
> 2.31.1
> 
> 
Signed-off-by: John Kacur <jkacur@redhat.com>
diff mbox series

Patch

diff --git a/rteval/sysinfo/kernel.py b/rteval/sysinfo/kernel.py
index f2e9d72ac2ef..ba5cadda40c5 100644
--- a/rteval/sysinfo/kernel.py
+++ b/rteval/sysinfo/kernel.py
@@ -47,8 +47,8 @@  class KernelInfo:
         policies = {'DLN': 'deadline', 'FF':'fifo', 'RR':'rrobin', 'TS':'other', '?':'unknown'}
         ret_kthreads = {}
         self.__log(Log.DEBUG, "getting kthread status")
-        cmd = '%s -eocommand,pid,policy,rtprio,comm' % getcmdpath('ps')
-        self.__log(Log.DEBUG, "cmd: %s" % cmd)
+        cmd = f"{getcmdpath('ps')} -eocommand,pid,policy,rtprio,comm"
+        self.__log(Log.DEBUG, f"cmd: {cmd}")
         c = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
         for p in c.stdout:
             v = p.strip().split()