@@ -125,7 +125,7 @@ def bail(self, message=None):
125
125
if message is None :
126
126
self .error ("Exiting due to error" )
127
127
else :
128
- self .error ("Exiting due to error: {}" . format ( message ) )
128
+ self .error (f "Exiting due to error: { message } " )
129
129
sys .exit (1 )
130
130
131
131
def error (self , message ):
@@ -258,7 +258,7 @@ def grep(self, search_term, location):
258
258
"""
259
259
location = self .path (location )
260
260
return self .run_command (
261
- "grep {} {}" . format ( search_term , location ) , suppress_message = True
261
+ f "grep { search_term } { location } " , suppress_message = True
262
262
)
263
263
264
264
@staticmethod
@@ -385,7 +385,7 @@ def require_root(self):
385
385
"""
386
386
if not self .is_root ():
387
387
print ("Installer must be run as root." )
388
- print ("Try 'sudo python3 {}'" . format ( self .script ()) )
388
+ print (f "Try 'sudo python3 { self .script ()} '" )
389
389
sys .exit (1 )
390
390
391
391
def write_text_file (self , path , content , append = True ):
@@ -516,7 +516,7 @@ def prompt_reboot(self):
516
516
517
517
def check_kernel_update_reboot_required (self ):
518
518
"""Checks if the pi needs to be rebooted since the last kernel update"""
519
- if not self .exists ("/lib/modules/{}" . format ( self .release ()) ):
519
+ if not self .exists (f "/lib/modules/{ self .release ()} " ):
520
520
self .error (
521
521
"OS has not been rebooted since last kernel update. "
522
522
"Please reboot and re-run the script."
0 commit comments