def prepare_disks(job, fs_desc, disk1_only=False, disk_list=None):
 if (not fs_desc):
  return (None, '', None)
 if (not isinstance(fs_desc, partition.FsOptions)):
  fs_desc = _legacy_str_to_test_flags(fs_desc)
 if (not disk_list):
  disk_list = get_disk_list()
 mkfs_bin = ('mkfs.' + fs_desc.fstype)
 if (fs_desc.fstype == 'ext4'):
  mkfs_bin = 'mkfs.ext4dev'
 try:
  utils.system(('which ' + mkfs_bin))
 except Exception:
  try:
   mkfs_bin = os.path.join(job.toolsdir, mkfs_bin)
   utils.system(('cp -ufp %s /sbin' % mkfs_bin))
  except Exception:
   raise error.TestError(('No mkfs binary available for ' + fs_desc.fstype))
 if (fs_desc.fstype == 'ext4'):
  fs_desc.mkfs_flags += ' -E test_fs'
 if disk1_only:
  disk_list = disk_list[0:1]
 mkfs_all_disks(job, disk_list, fs_desc.fstype, fs_desc.mkfs_flags, fs_desc.mount_options)
 return (disk_list[0]['mountpt'], fs_desc.fs_tag, disk_list)

def prepare_disks ( job , fs_desc , disk1_only = False , disk_list = None ) : if ( not fs_desc ) : return ( None , '' , None ) if ( not isinstance ( fs_desc , partition . FsOptions ) ) : fs_desc = _legacy_str_to_test_flags ( fs_desc ) if ( not disk_list ) : disk_list = get_disk_list ( ) mkfs_bin = ( 'mkfs.' + fs_desc . fstype ) if ( fs_desc . fstype == 'ext4' ) : mkfs_bin = 'mkfs.ext4dev' try : utils . system ( ( 'which ' + mkfs_bin ) ) except Exception : try : mkfs_bin = os . path . join ( job . toolsdir , mkfs_bin ) utils . system ( ( 'cp -ufp %s /sbin' % mkfs_bin ) ) except Exception : raise error . TestError ( ( 'No mkfs binary available for ' + fs_desc . fstype ) ) if ( fs_desc . fstype == 'ext4' ) : fs_desc . mkfs_flags += ' -E test_fs' if disk1_only : disk_list = disk_list [ 0 : 1 ] mkfs_all_disks ( job , disk_list , fs_desc . fstype , fs_desc . mkfs_flags , fs_desc . mount_options ) return ( disk_list [ 0 ] [ 'mountpt' ] , fs_desc . fs_tag , disk_list )
prepare drive(s) to contain the file system type / options given in the description line fs_desc .