Message ID | 20230601202734.813515-5-ashelat@redhat.com |
---|---|
State | Superseded |
Headers | show |
Series | Cover Letter | expand |
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 --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()
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(-)