Drop the len <= 50 validation check for domain names

Just let libvirt error out, since we have no idea if this is still
relevant.
This commit is contained in:
Cole Robinson 2014-01-17 18:42:15 -05:00
parent 958dea6c5f
commit d040bf3573
2 changed files with 2 additions and 6 deletions

View File

@ -74,7 +74,7 @@ class Guest(XMLBuilder):
@staticmethod
def validate_name(conn, name, check_collision):
util.validate_name(_("Guest"), name, lencheck=True)
util.validate_name(_("Guest"), name)
if not check_collision:
return

View File

@ -139,14 +139,10 @@ def validate_uuid(val):
return val
def validate_name(name_type, val, lencheck=False):
def validate_name(name_type, val):
if type(val) is not str or len(val) == 0:
raise ValueError(_("%s name must be a string") % name_type)
if lencheck:
if len(val) > 50:
raise ValueError(_("%s name must be less than 50 characters") %
name_type)
if re.match("^[0-9]+$", val):
raise ValueError(_("%s name can not be only numeric characters") %
name_type)