def LoadVolumes()

in container_agent/run_containers.py [0:0]


def LoadVolumes(volumes):
    """Process a "volumes" block of config and return a list of volumes."""

    # TODO(thockin): could be a map of name -> Volume
    all_vol_names = []
    for vol_index, vol in enumerate(volumes):
        # Get the container name.
        if 'name' not in vol:
            raise ConfigException('volumes[%d] has no name' % (vol_index))
        vol_name = vol['name']
        if not IsRfc1035Name(vol_name):
            raise ConfigException('volumes[%d].name is invalid: %s'
                                  % (vol_index, vol_name))
        if vol_name in all_vol_names:
            raise ConfigException('volumes[%d].name is not unique: %s'
                                  % (vol_index, vol_name))
        all_vol_names.append(vol_name)

    return all_vol_names