mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-26 10:03:54 +03:00
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:
parent
958dea6c5f
commit
d040bf3573
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user