def align_check(device, part_type, partition):
 _validate_device(device)
 if (part_type not in set(['minimal', 'optimal'])):
  raise CommandExecutionError('Invalid part_type passed to partition.align_check')
 try:
  int(partition)
 except Exception:
  raise CommandExecutionError('Invalid partition passed to partition.align_check')
 cmd = 'parted -m -s {0} align-check {1} {2}'.format(device, part_type, partition)
 out = __salt__['cmd.run'](cmd).splitlines()
 return out

def align_check ( device , part_type , partition ) : _validate_device ( device ) if ( part_type not in set ( [ 'minimal' , 'optimal' ] ) ) : raise CommandExecutionError ( 'Invalid part_type passed to partition.align_check' ) try : int ( partition ) except Exception : raise CommandExecutionError ( 'Invalid partition passed to partition.align_check' ) cmd = 'parted -m -s {0} align-check {1} {2}' . format ( device , part_type , partition ) out = __salt__ [ 'cmd.run' ] ( cmd ) . splitlines ( ) return out
check if partition satisfies the alignment constraint of part_type .