#NEWLINE# def _consume_partition( self , qos_values , size , direction ) : #NEWLINE# #INDENT# if ( qos_values [ 'PartitionDrive' ] [ 'PartitionSize' ] != 0 ) : #NEWLINE# #INDENT# partition_size = qos_values [ 'PartitionDrive' ] [ 'PartitionSize' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# partition_size = size #NEWLINE# #UNINDENT# part_per_drive = ( qos_values [ 'DriveCapacity' ] / partition_size ) #NEWLINE# if ( ( direction == ( - 1 ) ) and ( qos_values [ 'PartitionDrive' ] [ 'NumFreePartitions' ] == 0 ) ) : #NEWLINE# #INDENT# self . _consume_full_drive ( qos_values , direction ) #NEWLINE# qos_values [ 'PartitionDrive' ] [ 'NumFreePartitions' ] += part_per_drive #NEWLINE# #UNINDENT# qos_values [ 'PartitionDrive' ] [ 'NumFreePartitions' ] += direction #NEWLINE# qos_values [ 'PartitionDrive' ] [ 'NumOccupiedPartitions' ] -= direction #NEWLINE# if ( ( direction == 1 ) and ( qos_values [ 'PartitionDrive' ] [ 'NumFreePartitions' ] >= part_per_drive ) ) : #NEWLINE# #INDENT# self . _consume_full_drive ( qos_values , direction ) #NEWLINE# qos_values [ 'PartitionDrive' ] [ 'NumFreePartitions' ] -= part_per_drive