Mercurial > hg > Applications > virsh-wrapper
diff newvm.py @ 7:bff4054ed58f
looks like working...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 13 Nov 2012 11:14:34 +0900 |
parents | 25c14d1144a8 |
children | b2e2eec87764 |
line wrap: on
line diff
--- a/newvm.py Tue Nov 13 10:36:15 2012 +0900 +++ b/newvm.py Tue Nov 13 11:14:34 2012 +0900 @@ -17,9 +17,9 @@ m=re.match('^students/e(\d\d)/e(\d\d57)\d\d/0[1-4]$',name) if m is not None: if m.group(1)==m.group(2): - return 1 + return 0 else: - return 0 + return 1 elif re.match('^teachers/[-a-z0-9]+/0[1-4]$',name): return 0 else: @@ -37,7 +37,7 @@ def ie_mkdir(name): m=re.match('^(students/e\d\d/e\d\d57\d\d)/0[1-4]$',name) if m is None: - m=re.match('^(teachers/[-a-z0-9]+/0[1-4]$',name) + m=re.match('^(teachers/[-a-z0-9]+)/0[1-4]$',name) if m is not None: dir=m.group(1) ie_mkdir1('/media/fcs/'+dir) @@ -61,7 +61,7 @@ config = ET.parse(options.config) vm_name = options.name if ie_check_name(vm_name): - print "Bad vmname %s. Try students/e11/e115711/01 or teacher/kono/02" % vm_name + print "Bad vmname %s. Try students/e11/e115711/01 or teachers/kono/02" % vm_name sys.exit(1) ie_mkdir(vm_name)