Message ID | 20230601202734.813515-4-ashelat@redhat.com |
---|---|
State | Superseded |
Headers | show |
Series | Cover Letter | expand |
On Thu, 1 Jun 2023, Anubhav Shelat wrote: > Use f-strings in cputopology > > Signed-off-by: Anubhav Shelat <ashelat@redhat.com> > --- > rteval/sysinfo/cputopology.py | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/rteval/sysinfo/cputopology.py b/rteval/sysinfo/cputopology.py > index ced7e1f295b7..2bb632312320 100644 > --- a/rteval/sysinfo/cputopology.py > +++ b/rteval/sysinfo/cputopology.py > @@ -124,9 +124,7 @@ def unit_test(rootdir): > x.saveFormatFileEnc('-', 'UTF-8', 1) > > print(" ---- getCPUcores() / getCPUscokets() ---- ") > - print("CPU cores: %i (online: %i) - CPU sockets: %i" % (cputop.cpu_getCores(False), > - cputop.cpu_getCores(True), > - cputop.cpu_getSockets())) > + print(f"CPU cores: {cputop.cpu_getCores(False)} (online: {cputop.cpu_getCores(True)}) - CPU sockets: {cputop.cpu_getSockets()}") > return 0 > except Exception as e: > # import traceback > -- > 2.31.1 Signed-off-by: John Kacur <jkacur@redhat.com>
diff --git a/rteval/sysinfo/cputopology.py b/rteval/sysinfo/cputopology.py index ced7e1f295b7..2bb632312320 100644 --- a/rteval/sysinfo/cputopology.py +++ b/rteval/sysinfo/cputopology.py @@ -124,9 +124,7 @@ def unit_test(rootdir): x.saveFormatFileEnc('-', 'UTF-8', 1) print(" ---- getCPUcores() / getCPUscokets() ---- ") - print("CPU cores: %i (online: %i) - CPU sockets: %i" % (cputop.cpu_getCores(False), - cputop.cpu_getCores(True), - cputop.cpu_getSockets())) + print(f"CPU cores: {cputop.cpu_getCores(False)} (online: {cputop.cpu_getCores(True)}) - CPU sockets: {cputop.cpu_getSockets()}") return 0 except Exception as e: # import traceback
Use f-strings in cputopology Signed-off-by: Anubhav Shelat <ashelat@redhat.com> --- rteval/sysinfo/cputopology.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)