@@ -181,7 +181,7 @@ def update_fs_setup_devices(disk_setup, tformer):
181181 # update it with the response from 'tformer'
182182 for definition in disk_setup :
183183 if not isinstance (definition , dict ):
184- LOG .warn ("entry in disk_setup not a dict: %s" , definition )
184+ LOG .warning ("entry in disk_setup not a dict: %s" , definition )
185185 continue
186186
187187 origname = definition .get ('device' )
@@ -279,7 +279,7 @@ def is_device_valid(name, partition=False):
279279 try :
280280 d_type = device_type (name )
281281 except Exception :
282- LOG .warn ("Query against device %s failed" % name )
282+ LOG .warning ("Query against device %s failed" , name )
283283 return False
284284
285285 if partition and d_type == 'part' :
@@ -372,7 +372,7 @@ def find_device_node(device, fs_type=None, label=None, valid_targets=None,
372372 if not raw_device_used :
373373 return (device , False )
374374
375- LOG .warn ("Failed to find device during available device search." )
375+ LOG .warning ("Failed to find device during available device search." )
376376 return (None , False )
377377
378378
@@ -638,7 +638,7 @@ def purge_disk(device):
638638 if d ['type' ] not in ["disk" , "crypt" ]:
639639 wipefs_cmd = [WIPEFS_CMD , "--all" , "/dev/%s" % d ['name' ]]
640640 try :
641- LOG .info ("Purging filesystem on /dev/%s" % d ['name' ])
641+ LOG .info ("Purging filesystem on /dev/%s" , d ['name' ])
642642 util .subp (wipefs_cmd )
643643 except Exception :
644644 raise Exception ("Failed FS purge of /dev/%s" % d ['name' ])
@@ -700,7 +700,7 @@ def exec_mkpart_gpt(device, layout):
700700 [SGDISK_CMD ,
701701 '-t' , '{}:{}' .format (index , partition_type ), device ])
702702 except Exception :
703- LOG .warn ("Failed to partition device %s" % device )
703+ LOG .warning ("Failed to partition device %s" , device )
704704 raise
705705
706706 read_parttbl (device )
@@ -736,7 +736,7 @@ def mkpart(device, definition):
736736 # ensure that we get a real device rather than a symbolic link
737737 device = os .path .realpath (device )
738738
739- LOG .debug ("Checking values for %s definition" % device )
739+ LOG .debug ("Checking values for %s definition" , device )
740740 overwrite = definition .get ('overwrite' , False )
741741 layout = definition .get ('layout' , False )
742742 table_type = definition .get ('table_type' , 'mbr' )
@@ -766,15 +766,15 @@ def mkpart(device, definition):
766766
767767 LOG .debug ("Checking if device is safe to partition" )
768768 if not overwrite and (is_disk_used (device ) or is_filesystem (device )):
769- LOG .debug ("Skipping partitioning on configured device %s" % device )
769+ LOG .debug ("Skipping partitioning on configured device %s" , device )
770770 return
771771
772772 LOG .debug ("Checking for device size" )
773773 device_size = get_hdd_size (table_type , device )
774774
775775 LOG .debug ("Calculating partition layout" )
776776 part_definition = get_partition_layout (table_type , device_size , layout )
777- LOG .debug (" Layout is: %s" % part_definition )
777+ LOG .debug (" Layout is: %s" , part_definition )
778778
779779 LOG .debug ("Creating partition table on %s" , device )
780780 exec_mkpart (table_type , device , part_definition )
@@ -799,7 +799,7 @@ def lookup_force_flag(fs):
799799 if fs .lower () in flags :
800800 return flags [fs ]
801801
802- LOG .warn ("Force flag for %s is unknown." % fs )
802+ LOG .warning ("Force flag for %s is unknown." , fs )
803803 return ''
804804
805805
@@ -858,7 +858,7 @@ def mkfs(fs_cfg):
858858 LOG .debug ("Device %s has required file system" , device )
859859 return
860860 else :
861- LOG .warn ("Destroying filesystem on %s" , device )
861+ LOG .warning ("Destroying filesystem on %s" , device )
862862
863863 else :
864864 LOG .debug ("Device %s is cleared for formating" , device )
@@ -883,14 +883,14 @@ def mkfs(fs_cfg):
883883 return
884884
885885 if not reuse and fs_replace and device :
886- LOG .debug ("Replacing file system on %s as instructed." % device )
886+ LOG .debug ("Replacing file system on %s as instructed." , device )
887887
888888 if not device :
889889 LOG .debug ("No device aviable that matches request. "
890890 "Skipping fs creation for %s" , fs_cfg )
891891 return
892892 elif not partition or str (partition ).lower () == 'none' :
893- LOG .debug ("Using the raw device to place filesystem %s on" % label )
893+ LOG .debug ("Using the raw device to place filesystem %s on" , label )
894894
895895 else :
896896 LOG .debug ("Error in device identification handling." )
@@ -901,7 +901,7 @@ def mkfs(fs_cfg):
901901
902902 # Make sure the device is defined
903903 if not device :
904- LOG .warn ("Device is not known: %s" , device )
904+ LOG .warning ("Device is not known: %s" , device )
905905 return
906906
907907 # Check that we can create the FS
@@ -923,8 +923,8 @@ def mkfs(fs_cfg):
923923 mkfs_cmd = util .which ("mk%s" % fs_type )
924924
925925 if not mkfs_cmd :
926- LOG .warn ("Cannot create fstype '%s'. No mkfs.%s command" , fs_type ,
927- fs_type )
926+ LOG .warning ("Cannot create fstype '%s'. No mkfs.%s command" ,
927+ fs_type , fs_type )
928928 return
929929
930930 fs_cmd = [mkfs_cmd , device ]
0 commit comments