[systemd-devel] [PATCH] systemd-analyze: call os.uname() once

Dave Reisner d at falconindy.com
Mon Feb 27 05:14:58 PST 2012


Uses a format string, which is dependent on python 2.6.
---
 src/systemd-analyze |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/systemd-analyze b/src/systemd-analyze
index dad2ab8..8148bfb 100755
--- a/src/systemd-analyze
+++ b/src/systemd-analyze
@@ -172,7 +172,7 @@ elif sys.argv[1] == 'plot':
                                 osrel = osrel.strip('\"\n')
                                 break
 
-        banner = "%s %s (%s %s) %s" % (osrel, os.uname()[1], os.uname()[2], os.uname()[3], os.uname()[4])
+        banner = "{} {} ({} {}) {}".format(osrel, *(os.uname()[1:5]))
         draw_text(context, 0, -15, banner, hcenter = 0, vcenter = 1)
 
         for x in range(0, finish_time/10000 + 100, 100):
-- 
1.7.9.2



More information about the systemd-devel mailing list