'return the index of a volume'

def find_volume_by_name(self, volume, mounts=False):

    volumes = []
    if mounts:
        volumes = self.get_volume_mounts()
    else:
        volumes = self.get_volumes()
    for exist_volume in volumes:
        if (exist_volume['name'] == volume['name']):
            return exist_volume
    return None
