[Yum] fs-snapshot plugin: add included_vgs and excluded_vgs options to [lvm] section

Zdenek Pavlas zpavlas at redhat.com
Thu Mar 1 07:54:17 UTC 2012


Hi!

>           volume[lvm_key] = 1

This should be avoided for excluded volumes.  Now it
does not matter as the dict for excluded volumes is 
skipped anyway, but things change.

Moving the added code 13 lines up should fix this,
and also save the unnecessary Popen() if the volume
is excluded.

> +    # Check if include_vgs is defined in [lvm] section.
> +    # If so, we compare VG name with include_vgs list
> +    included_vgs = conduit.confString('lvm', 'included_vgs',
> default="").split()
> +    if len(included_vgs) > 0:
> +       vg = device.split("/")[2]
> +        if vg not in included_vgs :
> +           return 0
> +
> +    # Check if excluded_vgs is defined in [lvm] section.
> +    # If so, we compare VG name with excluded_vgs list
> +    excluded_vgs = conduit.confString('lvm', 'excluded_vgs',
> default="").split()
> +    if len(excluded_vgs) > 0:
> +        vg = device.split("/")[2]
> +        if vg in excluded_vgs :
> +            return 0

On my system I have:
/dev/mapper/vg_koblih-lv_root on / type ext4 (rw)

Using mount points (/) instead of vgs (vg_koblih-lv_root)
is easier, and there already is the "exclude" option that
works with mount points.  Why didn't you just add a single
"include" option instead?

> +snapshoted by this plugin. When this option is used, all volume

snapshotted

> groups not
> +listed are implicitely excluded.

implicitly


More information about the Yum mailing list