def str2vg(ns, vg):
    if isinstance(vg, LMIInstance):
        return vg
    if not isinstance(vg, str):
        raise TypeError("string or LMIInstance expected, got %s"
                % vg.__class__.__name__)
    query = 'SELECT * FROM LMI_VGStoragePool WHERE ElementName="%(vg)s"' \
            % {'vg': escape_cql(vg)}
    vgs = ns.wql(query)
    if not vgs:
        raise LmiFailed("Volume Group '%s' not found." % (vg,))
    if len(vgs) > 1:
        raise LmiFailed("Too many volume groups with name '%s' found." % (vg,))

    LOG().debug("String %s translated to Volume Group '%s'.",
            vg, vgs[0].InstanceID)
    return vgs[0]
Create a new table using the metadata from this one.
dataset/ETHPy150Open openlmi/openlmi-scripts/commands/storage/lmi/scripts/storage/common.py/str2vg--crossover with--dataset/ETHPy150Open wireservice/agate/agate/table/__init__.py/Table._fork