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:
Cole Robinson 2014-01-17 18:44:26 -05:00
parent d040bf3573
commit e151146cad
2 changed files with 5 additions and 3 deletions

View File

@ -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)

View File

@ -73,7 +73,8 @@ class Guest(XMLBuilder):
(str(e)))
@staticmethod
def validate_name(conn, name, check_collision):
def validate_name(conn, name, check_collision, validate=True):
if validate:
util.validate_name(_("Guest"), name)
if not check_collision:
return