Changeset 1066


Ignore:
Timestamp:
Oct 5, 2008, 6:01:54 PM (15 years ago)
Author:
broder
Message:

Explicitly lock an LV before trying to delete it

Location:
trunk/packages/sipb-xen-remctl-auto
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-remctl-auto/debian/changelog

    r998 r1066  
     1sipb-xen-remctl-auto (1.1) unstable; urgency=low
     2
     3  * Explicitly lock a volume before deleting it
     4
     5 -- Evan Broder <broder@mit.edu>  Sun, 05 Oct 2008 18:01:34 -0400
     6
    17sipb-xen-remctl-auto (1.0.21) unstable; urgency=low
    28
  • trunk/packages/sipb-xen-remctl-auto/files/usr/sbin/sipb-xen-lvm

    r837 r1066  
    4242    lvpath = "/dev/" + vg + "/" + lvname
    4343if subcommand == "lvremove":
     44    def error():
     45        print >>sys.stderr, "Error removing LV %s\n" % lvname
     46        sys.exit(1)
     47    rv = call(["/sbin/lvchange", "-a", "n", lvpath])
     48    if rv != 0:
     49        error()
     50    rv = call(["/sbin/lvchange", "-a", "ey", lvpath])
     51    if rv != 0:
     52        error()
    4453    rv = call(["/sbin/lvremove", "--force", lvpath])
     54    if rv != 0:
     55        error()
    4556    ensureoff(machine)
    46     if rv != 0:
    47         print >>sys.stderr, "Error removing LV %s\n" %(lvname,)
    48         sys.exit(1)
    4957elif subcommand == "lvresize":
    5058    size = sys.argv[4]
Note: See TracChangeset for help on using the changeset viewer.