Changeset 110 for trunk


Ignore:
Timestamp:
Oct 7, 2007, 3:16:21 AM (17 years ago)
Author:
andersk
Message:

Regex sanity checking.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-database/sipb-xen-database/client/usr/bin/sipb-xen-lvcreate

    r102 r110  
    88connect('postgres://sipb-xen@sipb-xen-dev.mit.edu/sipb_xen')
    99
     10def check(b):
     11    if not b:
     12        exit(1)
     13
    1014vg = "xenvg"
    1115for d in Disk.select():
     16    check(re.match('^[A-Za-z0-9]+$', d.guest_device_name))
    1217    machine = Machine.get(d.machine_id)
     18    check(re.match('^[A-Za-z0-9][A-Za-z0-9._-]*$', machine.name))
    1319    lvname = machine.name + "_" + d.guest_device_name
    1420    if not os.path.exists("/dev/%s/%s" % (vg, lvname)):
Note: See TracChangeset for help on using the changeset viewer.