mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-23 17:34:21 +03:00
cloner: Don't validate new clone name (bz 1054771)
Our validation check might not be up to date, WRT what characters are acceptable. So if we try to --auto-clone an existing valid VM with some characters we aren't expecting, we cause ourselves to error. Just skip the validation and let libvirt complain if something is wrong.
This commit is contained in:
parent
d040bf3573
commit
e151146cad
@ -100,7 +100,8 @@ class Cloner(object):
|
||||
def set_clone_name(self, name):
|
||||
try:
|
||||
Guest.validate_name(self.conn, name,
|
||||
check_collision=not self.replace)
|
||||
check_collision=not self.replace,
|
||||
validate=False)
|
||||
except ValueError, e:
|
||||
raise ValueError(_("Invalid name for new guest: %s") % e)
|
||||
|
||||
|
@ -73,8 +73,9 @@ class Guest(XMLBuilder):
|
||||
(str(e)))
|
||||
|
||||
@staticmethod
|
||||
def validate_name(conn, name, check_collision):
|
||||
util.validate_name(_("Guest"), name)
|
||||
def validate_name(conn, name, check_collision, validate=True):
|
||||
if validate:
|
||||
util.validate_name(_("Guest"), name)
|
||||
if not check_collision:
|
||||
return
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user