projects
/
invirt/packages/invirt-database.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
import re.
[invirt/packages/invirt-database.git]
/
client
/
usr
/
bin
/
sipb-xen-lvcreate
diff --git
a/client/usr/bin/sipb-xen-lvcreate
b/client/usr/bin/sipb-xen-lvcreate
index
25c5942
..
0b04f2d
100755
(executable)
--- a/
client/usr/bin/sipb-xen-lvcreate
+++ b/
client/usr/bin/sipb-xen-lvcreate
@@
-7,9
+7,15
@@
from subprocess import call
connect('postgres://sipb-xen@sipb-xen-dev.mit.edu/sipb_xen')
connect('postgres://sipb-xen@sipb-xen-dev.mit.edu/sipb_xen')
+def check(b):
+ if not b:
+ exit(1)
+
vg = "xenvg"
for d in Disk.select():
vg = "xenvg"
for d in Disk.select():
+ check(re.match('^[A-Za-z0-9]+$', d.guest_device_name))
machine = Machine.get(d.machine_id)
machine = Machine.get(d.machine_id)
+ check(re.match('^[A-Za-z0-9][A-Za-z0-9._-]*$', machine.name))
lvname = machine.name + "_" + d.guest_device_name
if not os.path.exists("/dev/%s/%s" % (vg, lvname)):
# LV doesn't exist
lvname = machine.name + "_" + d.guest_device_name
if not os.path.exists("/dev/%s/%s" % (vg, lvname)):
# LV doesn't exist