Force the first character of VM name to be a letter

Especially don't allow numeric-only name (our deserializer of qubes.xml
will convert it to int instead of str...).
This commit is contained in:
Marek Marczykowski-Górecki 2013-10-08 22:47:56 +02:00
parent 8f302bf2bc
commit 41ba079eb8

View File

@ -399,7 +399,7 @@ class QubesVm(object):
return False
def verify_name(self, name):
return re.match(r"^[a-zA-Z0-9_-]*$", name) is not None
return re.match(r"^[a-zA-Z][a-zA-Z0-9_-]*$", name) is not None
def pre_rename(self, new_name):
# fire hooks