core: do not reject already existing VMs with invalid name

It would break the system when the rules for names change. Warn instead.
This commit is contained in:
Marek Marczykowski-Górecki 2014-07-28 01:00:56 +02:00
parent 98540ac513
commit 279dc78a02

View File

@ -286,9 +286,12 @@ class QubesVm(object):
assert self.name is not None
if not self.verify_name(self.name):
raise QubesException("Invalid VM name (invalid characters, "
"over 31 chars long, or one of 'none', "
"'true', 'false')")
msg = ("'%s' is invalid VM name (invalid characters, over 31 chars long, "
"or one of 'none', 'true', 'false')") % self.name
if 'xml_element' in kwargs:
print >>sys.stderr, "WARNING: %s" % msg
else:
raise QubesException(msg)
if self.netvm is not None:
self.netvm.connected_vms[self.qid] = self