

def _delete_metadata(self, volume, keys, deletes=10, delete_size=3):
    'Delete volume metadata keys.\n\n        Note that ``len(keys)`` must be greater than or equal to\n        ``deletes * delete_size``.\n\n        :param volume: The volume to delete metadata from\n        :param deletes: how many operations to perform\n        :param delete_size: number of metadata keys to delete in each operation\n        :param keys: a list of keys to choose deletion candidates from\n        '
    if (len(keys) < (deletes * delete_size)):
        raise exceptions.InvalidArgumentsException(('Not enough metadata keys to delete: %(num_keys)s keys, but asked to delete %(num_deletes)s' % {
            'num_keys': len(keys),
            'num_deletes': (deletes * delete_size),
        }))
    keys = list(keys)
    random.shuffle(keys)
    action_name = ('cinder.delete_%s_metadatas_%s_times' % (delete_size, deletes))
    with atomic.ActionTimer(self, action_name):
        for i in range(deletes):
            to_del = keys[(i * delete_size):((i + 1) * delete_size)]
            self.clients('cinder').volumes.delete_metadata(volume, to_del)

dataset/ETHPy150Open openstack/rally/rally/plugins/openstack/scenarios/cinder/utils.py CinderScenario._delete_metadata/original